Hi all,
I’m currently experimenting Unit testing and NSubstitute. I’m using the version 5.5.0p2 of Unity.
Here is my test code. In fact, the TestMethod isn’t called and the test should fail.
But, sadly, the test pass correctly. It’s like the NSubstitute framwork cannot tell to Unity that the test has failed.
A few mounths ago (but cannot found my code), I have tested NSubstitute with a older version of Unity and everything worked fine…
Do you guys have any issue with NSubstitute and Unity 5.5 ?
using NUnit.Framework;
using NSubstitute;
[TestFixture]
public class SampleTests
{
[Test]
public void TestOfNSubstitute()
{
var instance = Substitute.For<TestClass>();
instance.Received().TestMethod();
}
}
public class TestClass
{
public void TestMethod() { }
}