unit testing - Custom Assertions with MSTest - Handling the AssertFailedException -


I would like to provide some custom assignment methods in my MSTest Unit Testing Framework, my own stable class is "customAssist", and given below Like the methods used:

  public static zero dates round silence (date of time expected value, date time actual value) {if (! (Expected.Value.Year == actualValue year and expected value Death == Actual value. Mute & Expected Origin Other. Day == real Valukde)) {Assign. Fail (string format ("expected:  & gt;", expected value, actual value)) ; }}  

The tests fail when the dates are not dated, but instead of the custom error message, I am just getting the message that the test throws an AssertFailedException. You can claim customs claims by MSTEst How can you control the dependent methods, and show the intelligent error message?

Instead of creating your own custom claim, you can use one of the currently available settings You can also try. for example:.


Comments