public override void SetUp() { base.SetUp(); _domainObject = DomainObjectIDs.Computer1.GetObject <Computer> (); _relatedObject = DomainObjectIDs.Employee3.GetObject <Employee> (); _endPointID = RelationEndPointID.Resolve(_domainObject, c => c.Employee); _endPoint = RelationEndPointObjectMother.CreateObjectEndPoint(_endPointID, _relatedObject.ID); _transactionEventSinkWithMock = MockRepository.GenerateStrictMock <IClientTransactionEventSink>(); _command = new ObjectEndPointSetSameCommand(_endPoint, _transactionEventSinkWithMock); }
public void ExpandToAllRelatedObjects_SetSame_Unidirectional() { var client = DomainObjectIDs.Client2.GetObject <Client> (); var unidirectionalEndPointID = RelationEndPointID.Resolve(client, c => c.ParentClient); var unidirectionalEndPoint = (IObjectEndPoint)TestableClientTransaction.DataManager.GetRelationEndPointWithLazyLoad(unidirectionalEndPointID); Assert.That(unidirectionalEndPoint.Definition.GetOppositeEndPointDefinition().IsAnonymous, Is.True); var setSameModification = new ObjectEndPointSetSameCommand(unidirectionalEndPoint, _transactionEventSinkWithMock); var bidirectionalModification = setSameModification.ExpandToAllRelatedObjects(); Assert.That(bidirectionalModification.GetNestedCommands(), Is.EqualTo(new[] { setSameModification })); }