Esempio n. 1
0
        public void SameNameInterface()
        {
            IDemo demo1 = MockRepository.Mock <IDemo>();

            Other.IDemo demo2 = MockRepository.Mock <Other.IDemo>();

            Assert.NotEqual(demo1.GetType(), demo2.GetType());
        }
Esempio n. 2
0
        public void SameNameInterface()
        {
            MockRepository mocks = new MockRepository();
            IDemo          demo1 = (IDemo)mocks.StrictMock(typeof(IDemo));

            Other.IDemo demo2 = (Other.IDemo)mocks.StrictMock(typeof(Other.IDemo));

            Assert.NotEqual(demo1.GetType(), demo2.GetType());
        }
        public void SameNameInterface()
        {
            IDemo demo1 = MockRepository.Mock <IDemo>();

            demo1.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault);
            Other.IDemo demo2 = MockRepository.Mock <Other.IDemo>();
            demo2.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault);

            Assert.NotEqual(demo1.GetType(), demo2.GetType());
        }
Esempio n. 4
0
        public void MockInterfaceWithSameName()
        {
            MockRepository mocks = new MockRepository();
            IDemo          demo  = (IDemo)mocks.StrictMock(typeof(IDemo));

            Expect.Call(demo.ReturnIntNoArgs()).Return(54);
            demo.VoidStringArg("54");
            Other.IDemo remotingDemo = (Other.IDemo)mocks.StrictMock(typeof(Other.IDemo));
            remotingDemo.ProcessString("in");
            mocks.ReplayAll();
            contextSwitcher.DoStuff(demo);
            contextSwitcher.DoStuff(remotingDemo);
            mocks.VerifyAll();
        }
Esempio n. 5
0
        public void MockInterfaceWithSameName()
        {
            IDemo demo = MockRepository.Mock <IDemo>();

            Other.IDemo remotingDemo = MockRepository.Mock <Other.IDemo>();

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

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

            remotingDemo.Expect(x => x.ProcessString("in"));

            contextSwitcher.DoStuff(demo);
            contextSwitcher.DoStuff(remotingDemo);

            demo.VerifyAllExpectations();
            remotingDemo.VerifyAllExpectations();
        }
 public void DoStuff(Other.IDemo remotingDemo)
 {
     remotingDemo.ProcessString("in");
 }