public void ExpandToAllRelatedObjects() { var extended = _deleteOrder1Command.ExpandToAllRelatedObjects(); var commands = extended.GetNestedCommands(); Assert.That(commands.Count, Is.EqualTo(6)); // self, Official, OrderTicket, Customer, OrderItem1, OrderItem2 Assert.That(commands, Has.Member(_deleteOrder1Command)); var officialCommand = GetEndPointModificationCommand(commands, DomainObjectIDs.Official1); Assert.That(officialCommand, Is.Not.Null); Assert.That(officialCommand.OldRelatedObject, Is.SameAs(_order1)); Assert.That(officialCommand.NewRelatedObject, Is.Null); var orderTicketCommand = GetEndPointModificationCommand(commands, DomainObjectIDs.OrderTicket1); Assert.That(orderTicketCommand, Is.Not.Null); Assert.That(orderTicketCommand.OldRelatedObject, Is.SameAs(_order1)); Assert.That(orderTicketCommand.NewRelatedObject, Is.Null); var customerCommand = GetEndPointModificationCommand(commands, DomainObjectIDs.Customer1); Assert.That(customerCommand, Is.Not.Null); Assert.That(customerCommand.OldRelatedObject, Is.SameAs(_order1)); var orderItem1Command = GetEndPointModificationCommand(commands, DomainObjectIDs.OrderItem1); Assert.That(orderItem1Command, Is.Not.Null); Assert.That(orderItem1Command.OldRelatedObject, Is.SameAs(_order1)); Assert.That(orderItem1Command.NewRelatedObject, Is.Null); var orderItem2Command = GetEndPointModificationCommand(commands, DomainObjectIDs.OrderItem2); Assert.That(orderItem2Command, Is.Not.Null); Assert.That(orderItem2Command.OldRelatedObject, Is.SameAs(_order1)); Assert.That(orderItem2Command.NewRelatedObject, Is.Null); }