Пример #1
0
        public void MockInterface()
        {
            MockRepository mocks = new MockRepository();
            IDemo          demo  = (IDemo)mocks.StrictMock(typeof(IDemo));

            Expect.Call(demo.ReturnIntNoArgs()).Return(54);
            demo.VoidStringArg("54");
            mocks.ReplayAll();
            contextSwitcher.DoStuff(demo);
            mocks.VerifyAll();
        }
Пример #2
0
        public void MockInterface()
        {
            IDemo demo = MockRepository.Mock <IDemo>();

            demo.Expect(x => x.ReturnIntNoArgs())
            .Return(54);

            demo.Expect(x => x.VoidStringArg("54"));

            contextSwitcher.DoStuff(demo);
            demo.VerifyAllExpectations();
        }
Пример #3
0
        public void MockInterface()
        {
            IDemo demo = MockRepository.Mock <IDemo>();

            demo.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault);

            demo.Expect(x => x.ReturnIntNoArgs())
            .Return(54);

            demo.Expect(x => x.VoidStringArg("54"));

            contextSwitcher.DoStuff(demo);
            demo.VerifyAllExpectations();
        }