public void Serialization() { var agent = new TestableDataContainerEndPointsRegistrationAgentBase( new SerializableRelationEndPointFactoryFake(), new SerializableRelationEndPointRegistrationAgentFake()); var deserializedAgent = Serializer.SerializeAndDeserialize(agent); Assert.That(deserializedAgent.EndPointFactory, Is.Not.Null); Assert.That(deserializedAgent.RegistrationAgent, Is.Not.Null); }
public override void SetUp() { base.SetUp(); _endPointFactoryMock = MockRepository.GenerateStrictMock <IRelationEndPointFactory>(); _registrationAgentMock = MockRepository.GenerateStrictMock <IRelationEndPointRegistrationAgent>(); _agentPartialMock = MockRepository.GeneratePartialMock <TestableDataContainerEndPointsRegistrationAgentBase> ( _endPointFactoryMock, _registrationAgentMock); _map = new RelationEndPointMap(MockRepository.GenerateStub <IClientTransactionEventSink> ()); _orderTicketEndPointID = RelationEndPointID.Create(DomainObjectIDs.Order1, typeof(Order), "OrderTicket"); _customerEndPointID = RelationEndPointID.Create(DomainObjectIDs.Order1, typeof(Order), "Customer"); _orderTicketEndPointMock = MockRepository.GenerateStrictMock <IVirtualObjectEndPoint>(); _orderTicketEndPointMock.Stub(stub => stub.ID).Return(_orderTicketEndPointID); _customerEndPointStub = MockRepository.GenerateStrictMock <IRealObjectEndPoint>(); _customerEndPointStub.Stub(stub => stub.ID).Return(_customerEndPointID); _orderDataContainer = DataContainer.CreateNew(DomainObjectIDs.Order1); }