diff --git a/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.Error_EmptyList.verified.txt b/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.Error_EmptyList.verified.txt index d9804b4ddd..30ac935311 100644 --- a/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.Error_EmptyList.verified.txt +++ b/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.Error_EmptyList.verified.txt @@ -1,4 +1,4 @@ { Type: ParseException, - Message: Expected content to contain `Directory:` or `VerifyException : Directory:` at the start. Ensure the current stable of Verify is being used. + Message: Expected content to contain `Directory:`, or `VerifyException : Directory:`, or `VerifyException: Directory:` at the start. Ensure the current stable of Verify is being used. } \ No newline at end of file diff --git a/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.cs b/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.cs index 6b242420e3..ad101a230f 100644 --- a/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.cs +++ b/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.cs @@ -120,7 +120,7 @@ public Task MsTest() { var exceptionMessage = $""" Test method TheTests.XAMLCombinerTests.TestOutput threw exception: - VerifyException : Directory: {Environment.CurrentDirectory} + VerifyException: Directory: {Environment.CurrentDirectory} NotEqual: - Received: XAMLCombinerTests.TestOutput.received.xaml Verified: XAMLCombinerTests.TestOutput.verified.xaml diff --git a/src/Verify.ExceptionParsing/Parser.cs b/src/Verify.ExceptionParsing/Parser.cs index af7319c029..0b8e777c7d 100644 --- a/src/Verify.ExceptionParsing/Parser.cs +++ b/src/Verify.ExceptionParsing/Parser.cs @@ -119,6 +119,16 @@ void ThrowIfEmpty(string directory) return directory; } + // MsTest + if (firstLine.StartsWith("VerifyException: Directory: ")) + { + var directory = firstLine[28..]; + + ThrowIfEmpty(directory); + + return directory; + } + if (firstLine.StartsWith("Directory: ")) { var directory = firstLine[11..]; @@ -128,7 +138,7 @@ void ThrowIfEmpty(string directory) return directory; } - throw new ParseException("Expected content to contain `Directory:` or `VerifyException : Directory:` at the start."); + throw new ParseException("Expected content to contain `Directory:`, or `VerifyException : Directory:`, or `VerifyException: Directory:` at the start."); } static string TrimStart(string next, string prefix)