Interested in a
Personal Demo ?

Name* :
Please Enter your Name
Company E–Mail* :
Please Enter a Valid Email


We need to maintain legacy applications that were not built to facilitate unit testing. Without Typemock we would be completely unable to effectively test these applications. Typemock boosts productivity because you do not have to explicitly code from the ground up with testing in mind, which can be difficult to handle. Typemock has been able to cover up the coupling and dependency sins that we all have leaked into our applications from time to time.  
Edmund D. Gorski, President, CodePoets, Inc.
Success stories


US Toll Free
Outside US
Get your printable quote
Buy online


Always Assert Something

a unit test is a way to check  something in the application. The most common way is to use the "Assert.xx" methods that are found in all common unit testing frameworks.
Without an assert your test is only going through the application's code, but is not really checking that something is true or false.

Possible types of asserts include:

  • [ExpectedException(...)] attribute on top of the test method
  • Assert.Throws(..)
  • Assert.IsTrue, IsFalse etc..
  • Verification against Isolation frameworks (Isolate.Verify, mock.AssertWasCalled, mock.Verify etc.)

What if I'm just testing that no exception is being thrown?

the only time it makes sense to not have an assert in your test is when you are testing that doing a specific action in the application under test does not throw an exception. in that case - your test name should point out that you are checking that no exception is being thrown - otherwise, whoever reads your test will not understand what is the expected behavior of the system under test.
Examples of such test names:
  1. Login_Called_DoesNotThrowException()
  2. Can_Call_Login_WithouException()
  3. LoginShouldNotThrowException()
  4. NoExcpeptionThrownFromLogin()

Just make sure that you mention that an exception is not thrown, for the sake of your test readers.