Ejemplo n.º 1
0
        public void RollbackWithDomainObject()
        {
            _order1.DeliveryDate = DateTime.Now;
            _mockRepository.BackToRecord(_order1MockEventReceiver);
            _mockRepository.BackToRecord(_clientTransactionExtensionMock);

            using (_mockRepository.Ordered())
            {
                _clientTransactionExtensionMock.RollingBack(null, null);
                LastCall.Constraints(Is.Same(TestableClientTransaction), Property.Value("Count", 1) & List.IsIn(_order1));

                _clientTransactionMockEventReceiver.RollingBack(_order1);

                _order1MockEventReceiver.RollingBack(null, null);
                LastCall.Constraints(Is.Same(_order1), Is.NotNull());

                _order1MockEventReceiver.RolledBack(null, null);
                LastCall.Constraints(Is.Same(_order1), Is.NotNull());

                _clientTransactionMockEventReceiver.RolledBack(_order1);

                _clientTransactionExtensionMock.RolledBack(null, null);
                LastCall.Constraints(Is.Same(TestableClientTransaction), Property.Value("Count", 1) & List.IsIn(_order1));
            }

            _mockRepository.ReplayAll();

            TestableClientTransaction.Rollback();

            _mockRepository.VerifyAll();
        }
Ejemplo n.º 2
0
        public void AddToOneToManyRelationWithOldRelatedObject()
        {
            DomainObjectCollection preloadedOrderItemsOfOrder1 = _order1.OrderItems;

            preloadedOrderItemsOfOrder1.EnsureDataComplete();

            OrderItem newOrderItem           = DomainObjectIDs.OrderItem3.GetObject <OrderItem>();
            Order     oldOrderOfNewOrderItem = newOrderItem.Order;

            oldOrderOfNewOrderItem.EnsureDataAvailable();

            _mockRepository.BackToRecord(_extension);
            var newOrderItemEventReceiver           = _mockRepository.StrictMock <DomainObjectMockEventReceiver> (newOrderItem);
            var oldOrderOfNewOrderItemEventReceiver = _mockRepository.StrictMock <DomainObjectMockEventReceiver> (oldOrderOfNewOrderItem);

            using (_mockRepository.Ordered())
            {
                _extension.RelationReading(
                    TestableClientTransaction, _order1, GetEndPointDefinition(typeof(Order), "OrderItems"), ValueAccess.Current);
                _extension.RelationRead(null, null, null, (ReadOnlyDomainObjectCollectionAdapter <DomainObject>)null, ValueAccess.Current);
                LastCall.Constraints(
                    Is.Same(TestableClientTransaction),
                    Is.Same(_order1),
                    Is.Equal(GetEndPointDefinition(typeof(Order), "OrderItems")),
                    Property.Value("Count", preloadedOrderItemsOfOrder1.Count) & new ContainsConstraint(preloadedOrderItemsOfOrder1),
                    Is.Equal(ValueAccess.Current));

                _extension.RelationChanging(
                    TestableClientTransaction, newOrderItem, GetEndPointDefinition(typeof(OrderItem), "Order"), oldOrderOfNewOrderItem, _order1);
                newOrderItemEventReceiver.RelationChanging(GetEndPointDefinition(typeof(OrderItem), "Order"), oldOrderOfNewOrderItem, _order1);

                _extension.RelationChanging(
                    TestableClientTransaction, _order1, GetEndPointDefinition(typeof(Order), "OrderItems"), null, newOrderItem);
                _order1EventReceiver.RelationChanging(GetEndPointDefinition(typeof(Order), "OrderItems"), null, newOrderItem);

                _extension.RelationChanging(
                    TestableClientTransaction, oldOrderOfNewOrderItem, GetEndPointDefinition(typeof(Order), "OrderItems"), newOrderItem, null);
                oldOrderOfNewOrderItemEventReceiver.RelationChanging(GetEndPointDefinition(typeof(Order), "OrderItems"), newOrderItem, null);


                oldOrderOfNewOrderItemEventReceiver.RelationChanged(GetEndPointDefinition(typeof(Order), "OrderItems"), newOrderItem, null);
                _extension.RelationChanged(
                    TestableClientTransaction, oldOrderOfNewOrderItem, GetEndPointDefinition(typeof(Order), "OrderItems"), newOrderItem, null);

                _order1EventReceiver.RelationChanged(GetEndPointDefinition(typeof(Order), "OrderItems"), null, newOrderItem);
                _extension.RelationChanged(TestableClientTransaction, _order1, GetEndPointDefinition(typeof(Order), "OrderItems"), null, newOrderItem);

                newOrderItemEventReceiver.RelationChanged(GetEndPointDefinition(typeof(OrderItem), "Order"), oldOrderOfNewOrderItem, _order1);
                _extension.RelationChanged(TestableClientTransaction, newOrderItem, GetEndPointDefinition(typeof(OrderItem), "Order"), oldOrderOfNewOrderItem, _order1);
            }

            _mockRepository.ReplayAll();

            _order1.OrderItems.Add(newOrderItem);

            _mockRepository.VerifyAll();
        }
        private static IConfirmer CreateMockConfirmerWithExpectation(MockRepository mockRepository, AbstractConstraint messageConstraint, bool confirmReturnValue)
        {
            IConfirmer confirmer = mockRepository.StrictMock <IConfirmer>();

            Expect.Call(() => confirmer.Confirm(null, null))
            .Constraints(messageConstraint, Is.NotNull())
            .Do((Delegates.Action <string, ConfirmationDelegate>)(
                    (message, confirmationDelegate) => confirmationDelegate(confirmReturnValue)));
            return(confirmer);
        }
Ejemplo n.º 4
0
        public void executing_the_table_grammar_will_execute_the_inner_grammar_for_each_child_row()
        {
            grammar.Execute(step);

            step.LeafFor("record").AllSteps().Each(childStep =>
            {
                inner.AssertWasCalled(x => x.Execute(childStep, null),
                                      x => { x.Constraints(Is.Same(childStep), Is.Anything()); });
            });
        }
 public void should_mark_the_selected_workspaces_in_the_project_token()
 {
     string[] workspaces = null;
     MockFor <IProjectHistory>().AssertWasCalled(x => x.MarkAsLastAccessed(null), x =>
     {
         x.Constraints(Is.Matching <ProjectToken>(t =>
         {
             workspaces = t.SelectedWorkspaces;
             return(true);
         }));
     });
 }
Ejemplo n.º 6
0
        public void ModifyOtherObjectInClientTransactionRollingBack()
        {
            _order1.DeliveryDate = DateTime.Now;
            _mockRepository.BackToRecord(_order1MockEventReceiver);
            _mockRepository.BackToRecord(_clientTransactionExtensionMock);

            using (_mockRepository.Ordered())
            {
                _clientTransactionExtensionMock.RollingBack(null, null);
                LastCall.Constraints(Is.Same(TestableClientTransaction), Property.Value("Count", 1) & List.IsIn(_order1));

                _clientTransactionMockEventReceiver.RollingBack(_order1);
                LastCall.Do(new EventHandler <ClientTransactionEventArgs> (ChangeCustomerNameCallback));

                _clientTransactionExtensionMock.PropertyValueChanging(TestableClientTransaction, null, null, null, null);
                LastCall.IgnoreArguments();
                _customer1MockEventReceiver.PropertyChanging(null, null);
                LastCall.IgnoreArguments();
                _customer1MockEventReceiver.PropertyChanged(null, null);
                LastCall.IgnoreArguments();
                _clientTransactionExtensionMock.PropertyValueChanged(TestableClientTransaction, null, null, null, null);
                LastCall.IgnoreArguments();

                _order1MockEventReceiver.RollingBack(null, null);
                LastCall.Constraints(Is.Same(_order1), Is.NotNull());

                _clientTransactionExtensionMock.RollingBack(null, null);
                LastCall.Constraints(Is.Same(TestableClientTransaction), Property.Value("Count", 1) & List.IsIn(_customer1));

                _clientTransactionMockEventReceiver.RollingBack(_customer1);

                _customer1MockEventReceiver.RollingBack(null, null);
                LastCall.Constraints(Is.Same(_customer1), Is.NotNull());

                _customer1MockEventReceiver.RolledBack(null, null);
                LastCall.Constraints(Is.Same(_customer1), Is.NotNull());

                _order1MockEventReceiver.RolledBack(null, null);
                LastCall.Constraints(Is.Same(_order1), Is.NotNull());

                _clientTransactionMockEventReceiver.RolledBack(_order1, _customer1);

                _clientTransactionExtensionMock.RolledBack(null, null);
                LastCall.Constraints(Is.Same(TestableClientTransaction), Property.Value("Count", 2) & new ContainsConstraint(_order1, _customer1));
            }

            _mockRepository.ReplayAll();

            TestableClientTransaction.Rollback();

            _mockRepository.VerifyAll();
        }
Ejemplo n.º 7
0
        public void ReplaceInOneToManyRelation()
        {
            Assert.Greater(_order1.OrderItems.Count, 0);
            OrderItem oldOrderItem = _order1.OrderItems[0];

            DomainObjectCollection preloadedOrderItems = _order1.OrderItems;
            OrderItem newOrderItem = OrderItem.NewObject();

            _mockRepository.BackToRecord(_extension);
            var oldOrderItemEventReceiver = _mockRepository.StrictMock <DomainObjectMockEventReceiver> (oldOrderItem);
            var newOrderItemEventReceiver = _mockRepository.StrictMock <DomainObjectMockEventReceiver> (newOrderItem);

            using (_mockRepository.Ordered())
            {
                _extension.RelationReading(
                    TestableClientTransaction, _order1, GetEndPointDefinition(typeof(Order), "OrderItems"), ValueAccess.Current);
                _extension.RelationRead(null, null, null, (ReadOnlyDomainObjectCollectionAdapter <DomainObject>)null, ValueAccess.Current);
                LastCall.Constraints(
                    Is.Same(TestableClientTransaction),
                    Is.Same(_order1),
                    Is.Equal(GetEndPointDefinition(typeof(Order), "OrderItems")),
                    Property.Value("Count", preloadedOrderItems.Count) & new ContainsConstraint(preloadedOrderItems),
                    Is.Equal(ValueAccess.Current));

                _extension.RelationChanging(
                    TestableClientTransaction, oldOrderItem, GetEndPointDefinition(typeof(OrderItem), "Order"), _order1, null);
                oldOrderItemEventReceiver.RelationChanging(GetEndPointDefinition(typeof(OrderItem), "Order"), _order1, null);

                _extension.RelationChanging(
                    TestableClientTransaction, newOrderItem, GetEndPointDefinition(typeof(OrderItem), "Order"), null, _order1);
                newOrderItemEventReceiver.RelationChanging(GetEndPointDefinition(typeof(OrderItem), "Order"), null, _order1);

                _extension.RelationChanging(
                    TestableClientTransaction, _order1, GetEndPointDefinition(typeof(Order), "OrderItems"), oldOrderItem, newOrderItem);
                _order1EventReceiver.RelationChanging(GetEndPointDefinition(typeof(Order), "OrderItems"), oldOrderItem, newOrderItem);

                _order1EventReceiver.RelationChanged(GetEndPointDefinition(typeof(Order), "OrderItems"), oldOrderItem, newOrderItem);
                _extension.RelationChanged(TestableClientTransaction, _order1, GetEndPointDefinition(typeof(Order), "OrderItems"), oldOrderItem, newOrderItem);

                newOrderItemEventReceiver.RelationChanged(GetEndPointDefinition(typeof(OrderItem), "Order"), null, _order1);
                _extension.RelationChanged(TestableClientTransaction, newOrderItem, GetEndPointDefinition(typeof(OrderItem), "Order"), null, _order1);

                oldOrderItemEventReceiver.RelationChanged(GetEndPointDefinition(typeof(OrderItem), "Order"), _order1, null);
                _extension.RelationChanged(TestableClientTransaction, oldOrderItem, GetEndPointDefinition(typeof(OrderItem), "Order"), _order1, null);
            }

            _mockRepository.ReplayAll();

            _order1.OrderItems[0] = newOrderItem;

            _mockRepository.VerifyAll();
        }
Ejemplo n.º 8
0
        protected override void beforeEach()
        {
            suite = new Suite("the suite");
            test  = new Test("test 1");
            suite.AddTest(test);

            Services.Inject(suite);

            driver = MockRepository.GenerateMock <ITestLineDriver>();
            MockFor <ISuiteView>().Expect(x => x.AddTest(test, null)).Constraints(Is.Equal(test), Is.Anything()).Return(
                driver);

            ClassUnderTest.Activate(null);
        }
        private IControlFactory SetupControlFactoryMockWithExpectationWithDelegate(
            MockRepository mockRepository, string message, string title,
            MessageBoxIcon messageBoxIcon, DialogResult dialogResultToReturn,
            ConfirmationDelegate confirmationDelegate)
        {
            IControlFactory controlFactory = mockRepository.StrictMock <IControlFactory>();

            controlFactory.Expect(
                factory => factory.ShowMessageBox(null, null, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Asterisk, null))
            .Return(dialogResultToReturn).Constraints(
                Is.Equal(message), Is.Equal(title), Is.Equal(MessageBoxButtons.YesNo),
                Is.Equal(messageBoxIcon), Is.Anything())
            .WhenCalled(invocation => confirmationDelegate(dialogResultToReturn == DialogResult.Yes));
            return(controlFactory);
        }
Ejemplo n.º 10
0
        public void ChangeOtherObjectBackToOriginalInClientTransactionRollingBack()
        {
            _order1.DeliveryDate = DateTime.Now;
            _customer1.Name      = "New customer name";
            _mockRepository.BackToRecord(_order1MockEventReceiver);
            _mockRepository.BackToRecord(_customer1MockEventReceiver);
            _mockRepository.BackToRecord(_clientTransactionExtensionMock);

            using (_mockRepository.Ordered())
            {
                _clientTransactionExtensionMock.RollingBack(null, null);
                LastCall.Constraints(Is.Same(TestableClientTransaction), Property.Value("Count", 2) & new ContainsConstraint(_order1, _customer1));

                _clientTransactionMockEventReceiver.RollingBack(_order1, _customer1);
                LastCall.Do(new EventHandler <ClientTransactionEventArgs> (ChangeCustomerNameBackToOriginalCallback));

                _clientTransactionExtensionMock.PropertyValueChanging(TestableClientTransaction, null, null, null, null);
                LastCall.IgnoreArguments();
                _customer1MockEventReceiver.PropertyChanging(null, null);
                LastCall.IgnoreArguments();
                _customer1MockEventReceiver.PropertyChanged(null, null);
                LastCall.IgnoreArguments();
                _clientTransactionExtensionMock.PropertyValueChanged(TestableClientTransaction, null, null, null, null);
                LastCall.IgnoreArguments();

                _order1MockEventReceiver.RollingBack(null, null);
                LastCall.Constraints(Is.Same(_order1), Is.NotNull());

                _customer1MockEventReceiver.RollingBack(null, null);
                LastCall.Constraints(Is.Same(_customer1), Is.NotNull());

                _order1MockEventReceiver.RolledBack(null, null);
                LastCall.Constraints(Is.Same(_order1), Is.NotNull());

                // Note: Customer1 must not raise a RolledBack event, because its Name has been set back to the OriginalValue.

                _clientTransactionMockEventReceiver.RolledBack(_order1);

                _clientTransactionExtensionMock.RolledBack(null, null);
                LastCall.Constraints(Is.Same(TestableClientTransaction), Property.Value("Count", 1) & List.IsIn(_order1));
            }

            _mockRepository.ReplayAll();

            TestableClientTransaction.Rollback();

            _mockRepository.VerifyAll();
        }
Ejemplo n.º 11
0
        public void run_the_tests()
        {
            ClassUnderTest.RunAllTests();

            MockFor <IFileSystem>().AssertWasCalled(x => x.DeleteFolder(setup.ResultsFolder));
            MockFor <IFileSystem>().AssertWasCalled(x => x.CreateFolder(setup.ResultsFolder));

            MockFor <IResultsSummary>().AssertWasCalled(x => x.Start(null, DateTime.Now),
                                                        o =>
            {
                o.Constraints(Is.Equal("All Tests in the directory"),
                              Is.TypeOf <DateTime>());
            });

            MockFor <ITestRunner>().AssertWasCalled(x => x.RunTests(tests, ClassUnderTest));
            MockFor <IResultsSummary>().AssertWasCalled(x => x.WriteFile(setup.ResultsFile));
        }
Ejemplo n.º 12
0
        public void CreateMemoryMementoSourceWhenTheMementoSourceIsExplicitlyDefinedInAttribute()
        {
            var mocks  = new MockRepository();
            var family = mocks.DynamicMock <IPluginFamily>();

            using (mocks.Record())
            {
                SetupResult.For(family.PluginType).Return(typeof(TypeWithDesignatedMementoSource));

                family.AddMementoSource(null);
                LastCall.Constraints(Is.TypeOf <CustomMementoSource>());
            }

            using (mocks.Playback())
            {
                PluginFamilyAttribute.ConfigureFamily(family);
            }
        }
        public void Test_DeleteBusinessObject_CustomConfirmationMessage()
        {
            //---------------Set up test pack-------------------
            MockRepository mockRepository  = new MockRepository();
            string         expectedMessage = TestUtil.GetRandomString();
            IConfirmer     confirmer       = CreateMockConfirmerWithExpectation(mockRepository,
                                                                                Is.Equal(expectedMessage), false);
            IBusinessObject boToDelete = mockRepository.StrictMock <IBusinessObject>();
            ConfirmingBusinessObjectDeletor confirmingBusinessObjectDeletor =
                new ConfirmingBusinessObjectDeletor(confirmer, t => expectedMessage);

            mockRepository.ReplayAll();
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            confirmingBusinessObjectDeletor.DeleteBusinessObject(boToDelete);
            //---------------Test Result -----------------------
            mockRepository.VerifyAll();
        }
        public void Test_DeleteBusinessObject_ConfirmationMessage()
        {
            //---------------Set up test pack-------------------
            MockRepository mockRepository  = new MockRepository();
            string         boToString      = TestUtil.GetRandomString();
            string         expectedMessage = string.Format("Are you certain you want to delete the object '{0}'", boToString);
            IConfirmer     confirmer       = CreateMockConfirmerWithExpectation(mockRepository,
                                                                                Is.Equal(expectedMessage), false);
            IBusinessObject boToDelete = new MockBOWithToString(boToString);
            ConfirmingBusinessObjectDeletor confirmingBusinessObjectDeletor = new ConfirmingBusinessObjectDeletor(confirmer);

            mockRepository.ReplayAll();
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            confirmingBusinessObjectDeletor.DeleteBusinessObject(boToDelete);
            //---------------Test Result -----------------------
            mockRepository.VerifyAll();
        }
Ejemplo n.º 15
0
        public void RollbackWithoutChanges()
        {
            using (_mockRepository.Ordered())
            {
                _clientTransactionExtensionMock.RollingBack(null, null);
                LastCall.Constraints(Is.Same(TestableClientTransaction), Property.Value("Count", 0));

                _clientTransactionMockEventReceiver.RollingBack();
                _clientTransactionMockEventReceiver.RolledBack();

                _clientTransactionExtensionMock.RolledBack(null, null);
                LastCall.Constraints(Is.Same(TestableClientTransaction), Property.Value("Count", 0));
            }

            _mockRepository.ReplayAll();

            TestableClientTransaction.Rollback();

            _mockRepository.VerifyAll();
        }
Ejemplo n.º 16
0
        protected override void beforeEach()
        {
            //NOTE: I'm told that the following 4 lines are the result of making things 'easier to mock'
            var context =
                new RequestContext(
                    new HttpContextWrapper(new HttpContext(new HttpRequest("foo.txt", "http://test", ""),
                                                           new HttpResponse(Console.Out))),
                    new RouteData());

            behaviorId = Guid.NewGuid();
            Services.Inject(behaviorId);

            captured = new CaptureArg();

            MockFor <IBehaviorFactory>()
            .Expect(x => x.BuildBehavior(null, behaviorId))
            .Constraints(captured, Is.Equal(behaviorId))
            .Return(MockFor <IActionBehavior>());

            handler = ClassUnderTest.GetHttpHandler(context);
        }
Ejemplo n.º 17
0
        protected override void beforeEach()
        {
            suite = StoryTeller.Testing.DataMother.BuildHierarchy(@"
t1,Success
t2,Success
t3,Success
");


            test1 = suite.FindTest("t1");
            test2 = suite.FindTest("t2");
            test3 = suite.FindTest("t3");

            Services.Inject(suite);

            driver1 = MockRepository.GenerateMock <ITestLineDriver>();
            driver2 = MockRepository.GenerateMock <ITestLineDriver>();
            driver3 = MockRepository.GenerateMock <ITestLineDriver>();


            MockFor <ISuiteView>().Expect(x => x.AddTest(null, null)).Constraints(Is.Equal(test1), Is.Anything()).Return(
                driver1);
            MockFor <ISuiteView>().Expect(x => x.AddTest(null, null)).Constraints(Is.Equal(test2), Is.Anything()).Return(
                driver2);
            MockFor <ISuiteView>().Expect(x => x.AddTest(null, null)).Constraints(Is.Equal(test3), Is.Anything()).Return(
                driver3);

            MockFor <ITestService>().Expect(x => x.GetStatus(test1)).Return(TestState.Queued);
            MockFor <ITestExplorer>().Expect(x => x.IconFor(test1)).Return(Icon.Pending);

            MockFor <ITestService>().Expect(x => x.GetStatus(test2)).Return(TestState.NotQueued);
            MockFor <ITestExplorer>().Expect(x => x.IconFor(test2)).Return(Icon.Success);

            MockFor <ITestService>().Expect(x => x.GetStatus(test3)).Return(TestState.NotQueued);
            MockFor <ITestExplorer>().Expect(x => x.IconFor(test3)).Return(Icon.Failed);

            ClassUnderTest.Activate(null);
        }
        public void registering_a_command_for_raising_event()
        {
            registry.CommandForEvent <ReloadTestsMessage>().Execute(null);

            container.GetInstance <IEventAggregator>().AssertWasCalled(x => x.SendMessage(new ReloadTestsMessage()),
                                                                       x => x.Constraints(Is.NotNull()));
        }
Ejemplo n.º 19
0
Archivo: BadXml.cs Proyecto: wsky/docu
 private AbstractConstraint IsMessage <T>(string message)
 {
     return(Is.Matching <IScreenMessage>(c => c is T && c.GetBody().FirstOrDefault(b => b == message) != null));
 }
Ejemplo n.º 20
0
 public void should_direct_the_status_bar_to_show_the_recycle_was_finished_and_failed()
 {
     MockFor <IStatusView>().AssertWasCalled(x => x.MarkCycleTime(DateTime.Now, false), x => x.Constraints(Is.TypeOf <DateTime>(), Is.Equal(false)));
 }
        public void TestTryProcess_ChildrenWorks()
        {
            XmlNode node = Globals.GetXmlNode("<control id=\"TestId\" type=\"TestType\"><elem1/>Text node<elem2><elemx/></elem2>  <elem3/></control>");
            XmlNode n1   = node.SelectSingleNode("elem1");
            XmlNode n2   = n1.NextSibling;
            XmlNode n3   = node.SelectSingleNode("elem2");
            XmlNode n4   = node.SelectSingleNode("elem3");

            IMember f1 = null, f2 = null, f3 = null, f4 = null;

            Expect.Call(() => renderFunction.AddDependency(null)).IgnoreArguments().Constraints(Property.Value("Name", "TestId"));

            using (mocks.Ordered()) {
                Expect.Call(template.HasMember("TestId")).Return(false);

                Expect.Call(template.HasMember("TestId_inner1")).Return(false);
                Expect.Call(() => template.AddMember(CreateRenderFunction("TestId_inner1", "", new IFragment[0]))).Do((Action <IMember>)(m => f1 = m));
                Expect.Call(() => docProcessor.ProcessRecursive(null, null, null)).Do((Action <XmlNode, ITemplate, IRenderFunction>)((n, tpl, f) => { Assert.AreEqual(n, n1); Assert.AreEqual(tpl, template); f.AddFragment(new LiteralFragment("[n1]")); })).IgnoreArguments();
                Expect.Call(template.HasMember("TestId_inner2")).Return(false);
                Expect.Call(() => template.AddMember(CreateRenderFunction("TestId_inner2", "", new IFragment[0]))).Do((Action <IMember>)(m => f2 = m));
                Expect.Call(() => docProcessor.ProcessRecursive(null, null, null)).Do((Action <XmlNode, ITemplate, IRenderFunction>)((n, tpl, f) => { Assert.AreEqual(n, n2); Assert.AreEqual(tpl, template); f.AddFragment(new LiteralFragment("[n2]")); })).IgnoreArguments();
                Expect.Call(template.HasMember("TestId_inner3")).Return(false);
                Expect.Call(() => template.AddMember(CreateRenderFunction("TestId_inner3", "", new IFragment[0]))).Do((Action <IMember>)(m => f3 = m));
                Expect.Call(() => docProcessor.ProcessRecursive(null, null, null)).Do((Action <XmlNode, ITemplate, IRenderFunction>)((n, tpl, f) => { Assert.AreEqual(n, n3); Assert.AreEqual(tpl, template); f.AddFragment(new LiteralFragment("[n3]")); })).IgnoreArguments();
                Expect.Call(template.HasMember("TestId_inner4")).Return(false);
                Expect.Call(() => template.AddMember(CreateRenderFunction("TestId_inner4", "", new IFragment[0]))).Do((Action <IMember>)(m => f4 = m));
                Expect.Call(() => docProcessor.ProcessRecursive(null, null, null)).Do((Action <XmlNode, ITemplate, IRenderFunction>)((n, tpl, f) => { Assert.AreEqual(n, n4); Assert.AreEqual(tpl, template); f.AddFragment(new LiteralFragment("[n4]")); })).IgnoreArguments();

                Expect.Call(template.HasMember("Container")).Return(true);
                Expect.Call(() => template.AddMember(null)).IgnoreArguments().Constraints(Is.Matching((InstantiatedControlMember m) =>
                                                                                                      m.Name == "TestId" &&
                                                                                                      m.TypeName == "TestType" &&
                                                                                                      m.CustomInstantiate == false &&
                                                                                                      m.AdditionalProperties.Count == 0 &&
                                                                                                      m.Dependencies.SequenceEqual(new[] { "TestId_inner1", "TestId_inner2", "TestId_inner3", "TestId_inner4" })));
            }

            mocks.ReplayAll();

            Assert.IsTrue(new ControlInstantiationNodeProcessor().TryProcess(docProcessor, node, false, template, renderFunction));
            Assert.AreEqual("[CONTROL id=TestId inner=4]", ConcatenatedFragments);
            Assert.AreEqual(f1, CreateRenderFunction("TestId_inner1", "", new LiteralFragment("[n1]")));
            Assert.AreEqual(f2, CreateRenderFunction("TestId_inner2", "", new LiteralFragment("[n2]")));
            Assert.AreEqual(f3, CreateRenderFunction("TestId_inner3", "", new LiteralFragment("[n3]")));
            Assert.AreEqual(f4, CreateRenderFunction("TestId_inner4", "", new LiteralFragment("[n4]")));

            mocks.VerifyAll();
        }