Exemplo n.º 1
0
        public void CanMockWithCtorParams()
        {
            WithParameters withParameters = MockRepository.Partial <WithParameters>(1);

            withParameters.Expect(x => x.Int)
            .Return(4);

            Assert.Equal(4, withParameters.Int);
            withParameters.VerifyAllExpectations();
        }
Exemplo n.º 2
0
        public void CanMockWithCtorParams()
        {
            WithParameters withParameters = MockRepository.Partial <WithParameters>(1);

            withParameters.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault);

            withParameters.Expect(x => x.Int)
            .Return(4);

            Assert.Equal(4, withParameters.Int);
            withParameters.VerifyAllExpectations();
        }
Exemplo n.º 3
0
        public void UsingCallOriginalWithSetter()
        {
            WithParameters withParameters = MockRepository.GenerateStrictMock <WithParameters>(1);

            withParameters.Expect(x => x.Int = 5)
            .PropertyBehavior();

            withParameters.Int = 12;
            withParameters.Int = 15;
            Assert.Equal(15, withParameters.Int);

            withParameters.VerifyAllExpectations();
        }