示例#1
0
        public void Test()
        {
            SimpleOperations myMock = MockRepository.Partial <SimpleOperations>();

            myMock.Expect(x => x.AddTwoValues(1, 2))
            .Return(3);

            Assert.Equal(3, myMock.AddTwoValues(1, 2));
            myMock.VerifyExpectations();
        }
        public void Test()
        {
            SimpleOperations myMock = MockRepository.Partial <SimpleOperations>();

            myMock.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault);

            myMock.Expect(x => x.AddTwoValues(1, 2))
            .Return(3);

            Assert.Equal(3, myMock.AddTwoValues(1, 2));
            myMock.VerifyExpectations();
        }