Пример #1
0
        public static ExpectationConfiguration CreateExpectation <T>(ServiceStub componentBeingConfigured, IStepConfigurableMessageSequence sequenceBeingConfigured, Func <T, bool> comparator)
        {
            var nextStep = new VerifyExpectation(sequenceBeingConfigured, new RecievedSingleMessage(Helpers.PackComparatorAsFuncOfObject(comparator)));

            sequenceBeingConfigured.SetNextStep(nextStep);

            return(new ExpectationConfiguration(componentBeingConfigured, sequenceBeingConfigured));
        }
Пример #2
0
        public ExpectationConfiguration Expect <T>(Func <T, bool> comparator) where T : class
        {
            var sequence = new RepeatingMessageSequence();

            _componentBeingConfigured.AddSequence(sequence);

            var nextStep = new VerifyExpectation(sequence, new RecievedSingleMessage(Helpers.PackComparatorAsFuncOfObject(comparator)));

            sequence.Trigger = nextStep;

            return(new ExpectationConfiguration(_componentBeingConfigured, sequence));
        }