开发者

MbUnit (gallio) and Visual Studio.Net Tests Not Completing or Debugging

I'm using Gallio\MbUnit 3.1 with ReSharper and Visual Studio 2008. Everything is working well except this type of test:

    [Test]
    [Row("test@badEmail@_test.com")]
    [Row("test@badEmail@_test.")]       
    public void IsValidEmail_Invalid_Emails_Should_Return_False(string invalidEmail)      
    {           
        Assert.IsFalse(AppHelper.IsValidEmail(invalidEmail),
                       "Email validation fa开发者_运维知识库iled for " + invalidEmail);
    }

The test doesn't complete or go in to debug mode only when I pass in a parameter E.g. 'string invalidEmail'. If I remove that prameter it seems to work normally.

It will run the test if I have:

    [Test]              
    public void IsValidEmail_Invalid_Emails_Should_Return_False()      
    {           
        var invalidName = test@badEmail@_test.com";
        Assert.IsFalse(AppHelper.IsValidEmail(invalidEmail),
                       "Email validation failed for " + invalidEmail);
    }

I appreciate that there may be better ways to achieve this test but I'm trying to work my way through a book and this is how it's explaining things.

Any help is appreciated.

Davy


Well, the test definitely looks ok.

Edit: I tried running your test using Gallio v3.2 build 381 and ReSharper v5.0 build 1645 and it seems to run fine.

Which versions of Gallio and ReSharper are you using?

You might also try using TestDriven.Net to run your tests in Visual Studio. There's a free personal edition that works quite well. I find it more efficient than using the ReSharper test runner.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜