예제 #1
0
        public void Setter_Expectation_With_Custom_Ignore_Arguments()
        {
            IBar bar = MockRepository.Mock <IBar>();

            bar.ExpectProperty(x => x.Foo = Arg <int> .Is.Anything);

            bar.Foo = 2;
            bar.VerifyAllExpectations();
        }
예제 #2
0
        public void Setter_Expectation_Not_Fullfilled()
        {
            IBar bar = MockRepository.Mock <IBar>();

            bar.ExpectProperty(x => x.Foo = Arg <int> .Is.Anything);

            Assert.Throws <ExpectationViolationException>(
                () => bar.VerifyAllExpectations());
        }
        public void Setter_Expectation_With_Custom_Ignore_Arguments()
        {
            IBar bar = MockRepository.Mock <IBar>();

            bar.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault);
            bar.ExpectProperty(x => x.Foo = Arg <int> .Is.Anything);

            bar.Foo = 2;
            bar.VerifyAllExpectations();
        }
예제 #4
0
        public void TestMethodWhereALocalStubIsInvokedWithVerifyAllExpectations()
        {
            IBar localStub = MockRepository.GenerateStub <IBar>();

            localStub.VerifyAllExpectations();
        }
예제 #5
0
 public void TestMethodWhereTwoFieldStubsAreInvokedWithVerifyAllExpectations()
 {
     _barStub.VerifyAllExpectations();
     _barStubTwo.VerifyAllExpectations();
 }
예제 #6
0
 public void TestMethodWhereAFieldStubIsInvokedWithVerifyAllExpectations()
 {
     _barStub.VerifyAllExpectations();
 }