Esempio n. 1
0
        public void Iterate_does_not_clear_xml_message_when_there_are_still_iterations_left()
        {
            var expected = new XElement("ClassQueryRq",
                                        new XAttribute("iterator", "Continue"),
                                        new XAttribute("iteratorID", 123),
                                        new XElement("MaxReturned", 20));

            var session = MockRepository.GenerateStub <IQBSessionInternal>();

            session.Stub(x => x.ProcessRequest(null))
            .IgnoreArguments()
            .Return(ValidSessionResponseForIteratedClassQueries())
            .Repeat.Any();

            var daoChild = new QueryBaseChild(session, "ClassQueryRq", "ClassQueryRs");

            daoChild.MaxReturned(20).Iterate();
            //This should still have the MaxReturned XElement set since we are not
            //at the end of the iteration
            daoChild.Iterate();

            var actual = session.GetArgumentsForCallsMadeOn(x => x.ProcessRequest(null))[1][0] as XElement;

            AssertXmlAreEqual(expected, actual);
        }
Esempio n. 2
0
        public void Iterate_throws_exception_if_MaxReturned_not_set()
        {
            var session  = MockRepository.GenerateStub <IQBSessionInternal>();
            var daoChild = new QueryBaseChild(session, "ClassQueryRq", "ClassQueryRs");

            daoChild.Iterate();
        }