Ejemplo n.º 1
0
        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();
        }