views:

23

answers:

1

My Sample Test Class:

namespace Test
{

[TestClass]
public class SampleTest
{
    [TestMethod]
    public void Test()
    {
        Assert.IsTrue(true); // <---------- LOOK 
    }

}

But if i do that:

namespace Test
{

[TestClass]
public class SampleTest
{
    [TestMethod]
    public void Test()
    {
        Assert.IsTrue(false); // <---------- LOOK 
    }

}

i win a AssertFailedException, the test break on this line, however the test dont show failure like a first test do with success!!

Help, Thank´s!!!

My Reference: http://www.jeff.wilcox.name/2008/03/silverlight2-unit-testing/

+1  A: 

It's not clear what you are expecting to see and what the problem you are experiencing is.

Based on my deciphering skills, I think you're running into a paradigm difference.

In unit testing, any failed test will often cause a hard error. The reason being that you're not expecting to fail, so when you do, you want attention called to the failure, rather than just a nice test failed message.

John Weldon
+1, exceptions like assert failed exception are how failures are communicated in the framework.
Jeff Wilcox