Ejemplo n.º 1
0
        public void Setter_Expectation_With_Wrong_Argument()
        {
            IBar bar = MockRepository.Mock <IBar>();

            bar.ExpectProperty(x => x.Foo = 1);

            bar.Foo = 0;

            Assert.Throws <ExpectationViolationException>(
                () => bar.VerifyExpectations(true));
        }
        public void Setter_Expectation_With_Wrong_Argument()
        {
            IBar bar = MockRepository.Mock <IBar>();

            bar.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault);
            bar.ExpectProperty(x => x.Foo = 1);

            bar.Foo = 0;

            Assert.Throws <ExpectationViolationException>(
                () => bar.VerifyExpectations(true));
        }