O'Reilly logo

Software Testing using Visual Studio 2012 by Satheesh Kumar. N, Subashni. S

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Assert statements

The assert statement is used for comparing the result from the original method with the expected result, and then passing or failing the test based on the match. Whatever the result produced by the method may be, the end result of the test method depends on the return value of the assert method. The assert statement takes care of setting the result. There are multiple overloaded methods supported by the Assert statement to set the return value to Pass or Fail or Inconclusive. If the assert statement is not present in the test method, the test method will always return a Pass value. If there are many assert statements in the test method, the test will be in Pass state until one of the assert statements returns Fail.

In the preceding ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required