Пример #1
0
        public void MockVoidDelegateWithNoParams()
        {
            VoidDelegateWithParams d = MockRepository.Mock <VoidDelegateWithParams>();

            d.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault);

            d.Expect(x => x("abc"));
            d.Expect(x => x("efg"));

            d("abc");
            d("efg");
            d("hij");

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