public bool Stub() { var stub = new ThingStub(); stub.DoSomething(); return(stub.Called); }
public void Stub() { var stub = new ThingStub(); stub.DoSomething(); if (!stub.Called) { throw new Exception(); } }
public override void Stub() { var stub = new ThingStub(); stub.DoSomething(); if (!stub.Called) { throw new TargetException(); } }
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 override int Stub() { var stub = new ThingStub(); return(stub.Zero()); }
public void Stub() { var stub = new ThingStub(); stub.DoNothing(); }
public int Stub() { var stub = new ThingStub(); return(stub.One()); }
public override void Stub() { var stub = new ThingStub(); stub.DoNothing(); }
public override void Stub() { var stub = new ThingStub(); stub.OneParameter(0); }