开发者

Problem SilverLight UnitTest Exception, Help!

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开发者_如何学Python
{

[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/


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.


Failures are more technically detailed than successes, this is to help you to find the cause of them, like when you see a stack trace and not simply "Error."

Any exception that is not explicitly attended implies (and somewhere should be also written in the output), that the test is failed as you were expecting.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜