public VerifyOnly() { stub = new ThingStub(); stub.DoSomething(); fake = A.Fake <IThingy>(); fake.DoSomething(); mock = new Mock <IThingy>(); mock.Object.DoSomething(); sub = Substitute.For <IThingy>(); sub.DoSomething(); rock = Rock.Create <IThingy>(); rock.Handle(r => r.DoSomething()); rock.Make().DoSomething(); }
public CallbackOnly() { stub = new ThingStub(); fake = A.Fake <IThingy>(); A.CallTo(() => fake.DoSomething()).Invokes(f => fakeCalled = true); var mockSetup = new Mock <IThingy>(); mockSetup.Setup(m => m.DoSomething()).Callback(() => mockCalled = true); mock = mockSetup.Object; sub = Substitute.For <IThingy>(); sub.When(s => s.DoSomething()).Do(c => subCalled = true); var rock = Rock.Create <IThingy>(); rock.Handle(r => r.DoSomething(), () => rockCalled = true); chunk = rock.Make(); }
public void FakeItEasy() => A.CallTo(() => fake.DoSomething()).MustHaveHappened();
public bool Rocks() { rockCalled = false; chunk.DoSomething(); return(rockCalled); }
public bool NSubstitute() { subCalled = false; sub.DoSomething(); return(subCalled); }
public bool Moq() { mockCalled = false; mock.DoSomething(); return(mockCalled); }
//[Benchmark] public bool FakeItEasy() { fakeCalled = false; fake.DoSomething(); return(fakeCalled); }