Пример #1
0
            private void AssertBatchBehaviorFor(IQuery query, int expectedMessageCount)
            {
                IObjectSet result   = query.Execute();
                IList      messages = MessageCollector.ForServerDispatcher(ServerDispatcher());

                Assert.AreEqual("foo", ((BatchActivationTestCase.BatchActivationTestUnit.Item)result
                                        .Next()).name);
                Assert.AreEqual(expectedMessageCount, messages.Count, messages.ToString());
            }
Пример #2
0
            private void AssertBatchBehaviorFor(IQuery query, int expectedMessageCount)
            {
                var result   = query.Execute();
                var messages = MessageCollector.ForServerDispatcher(ServerDispatcher());

                Assert.AreEqual("foo", ((Item)result
                                        .Next()).name);
                Assert.AreEqual(expectedMessageCount, messages.Count, messages.ToString());
            }
Пример #3
0
        private void AssertQueryIterationProtocol(IQuery query, MsgD expectedResultMessage
                                                  , PrefetchConfigurationTestCase.Stimulus[] stimuli)
        {
            IList      messages = MessageCollector.ForServerDispatcher(ServerDispatcher());
            IObjectSet result   = query.Execute();

            AssertMessages(messages, new IMessage[] { expectedResultMessage });
            messages.Clear();
            for (int stimulusIndex = 0; stimulusIndex < stimuli.Length; ++stimulusIndex)
            {
                PrefetchConfigurationTestCase.Stimulus stimulus = stimuli[stimulusIndex];
                stimulus.ActUpon(result);
                AssertMessages(messages, stimulus.expectedMessagesAfter);
                messages.Clear();
            }
            if (result.HasNext())
            {
                Assert.Fail("Unexpected item: " + ((PrefetchConfigurationTestCase.Item)result.Next
                                                       ()));
            }
            AssertMessages(messages, new IMessage[] {  });
        }
Пример #4
0
        private void AssertQueryIterationProtocol(IQuery query, MsgD expectedResultMessage
                                                  , Stimulus[] stimuli)
        {
            var messages = MessageCollector.ForServerDispatcher(ServerDispatcher());
            var result   = query.Execute();

            AssertMessages(messages, new IMessage[] { expectedResultMessage });
            messages.Clear();
            for (var stimulusIndex = 0; stimulusIndex < stimuli.Length; ++stimulusIndex)
            {
                var stimulus = stimuli[stimulusIndex];
                stimulus.ActUpon(result);
                AssertMessages(messages, stimulus.expectedMessagesAfter);
                messages.Clear();
            }
            if (result.HasNext())
            {
                Assert.Fail("Unexpected item: " + ((Item)result.Next
                                                       ()));
            }
            AssertMessages(messages, new IMessage[] {});
        }