-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert("{","x") throws System.FormatException #25373
Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert("{","x") throws System.FormatException #25373
Comments
Original stack overflow question: https://stackoverflow.com/questions/72179163/ |
@Haplois Please have a look, this seems like formatting issue where we don't escape the groups in provided string. |
Bug in https://github.com/microsoft/testfx/blob/23793c5d6e7ebcd08d455674927bbf3031697e74/src/TestFramework/MSTest.Core/Assertions/StringAssert.cs#L201-L210, and similar bugs in other methods that call Assert.HandleFail. I didn't find a bug already filed for this in the testfx repo. |
That is an incomplete fix; the parameters array might not be empty. Consider |
Nice catch @KalleOlaviNiemitalo! I will do a follow-up fix. |
Describe the bug
A clear and concise description of what the bug is.
Microsoft.VisualStudio.TestTools.UnitTesting.StringAssert("{","x")
throwsSystem.FormatException
instead ofAssertFailedException
.To Reproduce
StringAssert.Contains(":-{","x");
See: https://github.com/nonZero/StringAssert_Demo
Exceptions (if any)
Further technical details
The text was updated successfully, but these errors were encountered: