Reputation: 4283
I'm trying to get NUNIT working with ReSharper, I'm using NUNIT version 2.5.10.11092.
When I run a test I get a windows dialog popup stating the assertion has failed, this is for a basic test.
[TestFixture]
public class MessageService
{
[Test]
public void BasicTest()
{
int number = 8;
Debug.Assert(number== 9);
}
}
Now the test did fail as intended but instead of having the test runner display the nice green red signals to suggest pass or fail I get this ugly stack trace popup, of which I can either ignore or abort.
I'd rather just use the built in ReShapper runner to display the outcome of the tests.
Any ideas whats wrong?
Thanks
Upvotes: 0
Views: 281
Reputation: 301327
I think you want to use Nunit assertions
Assert.AreEqual(9,number);
Upvotes: 1
Reputation: 141668
Debug.Assert
is part of the .NET Framework, not NUnit. Resharper doesn't know how to handle that. You should use NUnit assertions instead for "nice" output:
[Test]
public void BasicTest()
{
int number = 8;
Assert.AreEqual(9, number);
//or
Assert.That(number, Is.EqualTo(9));
}
There are different syntax assertions in NUnit. Which you use is up to you.
Upvotes: 4