You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following method the exception fails and throws AssertFailedException.
The exception message
[TestMethod,ExpectedException(typeof(AssertFailedException))]publicasyncTaskAssertThrowsExceptionAsync_Failure_OldAssertion(){// arrangestaticTaskThrowExceptionAsync()=>thrownewInvalidOperationException();Func<Task>action=ThrowExceptionAsync;// old assertion:awaitAssert.ThrowsExceptionAsync<ArgumentException>(action);}
Steps To Reproduce
using Assert.ThrowsException or Assert.ThrowsExceptionAsync and failing throws an AssertFailedException exception where the Message property contains "Exception Message: <the message>" and the "Stack Trace: at <stack-trace>"
Expected behavior
The exception's Message property should only include the fail message (like any other assertion method in mstest)