A NUnit addin that uses FakeItEasy! to inject fakes into test methods.
Copy FakeInjectionAddin.dll
and FakeItEasy.dll
into <NUnit-directory>/addins
.
[Test]
public void Test (IFoo foo)
{
// Use fake in test.
A.CallTo (() => foo.Bar()).Returns ("baz");
// ...
}
You may use the RequiredAddin
attribute to signal test runners that the addin is required to run your tests.
This step is optional but may be helpful to avoid confusion.
[assembly: NUnit.Framework.RequiredAddin("FakeInjectionAddin")]