コード例 #1
0
        public void FailToMeetOrderedChildScopeWrongToFewNumberOfInvocations()
        {
            using (expectationScope.BeginOrdered())
            {
                AddExpectation(Expectation.ShouldMeetAtLeast(2, invocation1));
                AddExpectation(Expectation.ShouldMeetAtLeastOnce(invocation2));
            }


            TryMeetSucceeds(invocation1);

            TryMeetFails(invocation2);
        }
コード例 #2
0
        public void MeetOrderedChildScope()
        {
            using (expectationScope.BeginOrdered())
            {
                AddExpectation(Expectation.ShouldMeetAtMost(1, invocation1));
                AddExpectation(Expectation.ShouldMeetAtLeast(2, invocation2));
                AddExpectation(Expectation.ShouldMeetAtMost(3, invocation3));
            }


            TryMeetSucceeds(invocation1);

            TryMeetSucceeds(invocation2);
            TryMeetSucceeds(invocation2);
            TryMeetSucceeds(invocation2);

            TryMeetSucceeds(invocation3);
            TryMeetSucceeds(invocation3);
            TryMeetSucceeds(invocation3);


            AssertHasBeenMet();
        }