public void EndPointLoader_Serializable() { var endPointLoader = new CollectionEndPoint.EndPointLoader(new SerializableLazyLoaderFake()); var deserializedInstance = FlattenedSerializer.SerializeAndDeserialize(endPointLoader); Assert.That(deserializedInstance.LazyLoader, Is.Not.Null); }
public void FlattenedSerializable() { var state = new UnsynchronizedRealObjectEndPointSyncState(); var result = FlattenedSerializer.SerializeAndDeserialize(state); Assert.That(result, Is.Not.Null); }
public void FlattenedSerializable() { var fakeProvider = new SerializableRelationEndPointProviderFake(); var state = new UnknownRealObjectEndPointSyncState(fakeProvider); var result = FlattenedSerializer.SerializeAndDeserialize(state); Assert.That(result, Is.Not.Null); Assert.That(result.VirtualEndPointProvider, Is.Not.Null); }
public void FlattenedSerializable() { var state = new SynchronizedRealObjectEndPointSyncState( new SerializableRelationEndPointProviderFake(), new SerializableClientTransactionEventSinkFake()); var result = FlattenedSerializer.SerializeAndDeserialize(state); Assert.That(result, Is.Not.Null); Assert.That(result.EndPointProvider, Is.Not.Null); Assert.That(result.TransactionEventSink, Is.Not.Null); }
public void Serialization() { var innerEndPoint = new SerializableCollectionEndPointFake(); var listener = new SerializableVirtualEndPointStateUpdateListenerFake(); var instance = new StateUpdateRaisingCollectionEndPointDecorator(innerEndPoint, listener); var deserializedInstance = FlattenedSerializer.SerializeAndDeserialize(instance); Assert.That(deserializedInstance.InnerEndPoint, Is.Not.Null); Assert.That(deserializedInstance.Listener, Is.Not.Null); }
public void FlattenedSerializable() { var data = new VirtualObjectEndPointDataManager(_endPointID); var endPointFake = new SerializableRealObjectEndPointFake(null, DomainObjectMother.CreateFakeObject <Order> (DomainObjectIDs.Order1)); data.RegisterOriginalOppositeEndPoint(endPointFake); var deserializedInstance = FlattenedSerializer.SerializeAndDeserialize(data); Assert.That(deserializedInstance.EndPointID, Is.Not.Null); Assert.That(deserializedInstance.OriginalOppositeEndPoint, Is.Not.Null); Assert.That(deserializedInstance.OriginalOppositeObject, Is.Not.Null); Assert.That(deserializedInstance.CurrentOppositeEndPoint, Is.Not.Null); Assert.That(deserializedInstance.CurrentOppositeObject, Is.Not.Null); }
public void FlattenedSerializable() { var state = new TestableCompleteVirtualEndPointLoadState( new SerializableVirtualEndPointDataManagerFake(), new SerializableRelationEndPointProviderFake(), new SerializableClientTransactionEventSinkFake()); var oppositeEndPoint = new SerializableRealObjectEndPointFake(null, _relatedObject); AddUnsynchronizedOppositeEndPoint(state, oppositeEndPoint); var result = FlattenedSerializer.SerializeAndDeserialize(state); Assert.That(result, Is.Not.Null); Assert.That(result.DataManager, Is.Not.Null); Assert.That(result.EndPointProvider, Is.Not.Null); Assert.That(result.TransactionEventSink, Is.Not.Null); Assert.That(result.UnsynchronizedOppositeEndPoints.Count, Is.EqualTo(1)); }
public void FlattenedSerializable() { var changeDetectionStrategy = new SerializableCollectionEndPointChangeDetectionStrategyFake(); var data = new CollectionEndPointDataManager(_endPointID, changeDetectionStrategy); var endPointFake = new SerializableRealObjectEndPointFake(null, _domainObject1); data.RegisterOriginalOppositeEndPoint(endPointFake); data.RegisterOriginalItemWithoutEndPoint(_domainObject2); var deserializedInstance = FlattenedSerializer.SerializeAndDeserialize(data); Assert.That(deserializedInstance.EndPointID, Is.Not.Null); Assert.That(deserializedInstance.ChangeDetectionStrategy, Is.Not.Null); Assert.That(deserializedInstance.CollectionData.Count, Is.EqualTo(2)); Assert.That(deserializedInstance.OriginalCollectionData.Count, Is.EqualTo(2)); Assert.That(deserializedInstance.OriginalOppositeEndPoints.Length, Is.EqualTo(1)); Assert.That(deserializedInstance.OriginalItemsWithoutEndPoints.Length, Is.EqualTo(1)); Assert.That(deserializedInstance.CurrentOppositeEndPoints.Length, Is.EqualTo(1)); }
public void FlattenedSerializable() { var lazyLoader = new SerializableVirtualEndPointLoaderFake < IVirtualObjectEndPoint, DomainObject, IVirtualObjectEndPointDataManager, IVirtualObjectEndPointLoadState>(); var dataManagerFactory = new SerializableVirtualObjectEndPointDataManagerFactoryFake(); var state = new IncompleteVirtualObjectEndPointLoadState(lazyLoader, dataManagerFactory); AddOriginalOppositeEndPoint(state, new SerializableRealObjectEndPointFake(null, _relatedObject)); var result = FlattenedSerializer.SerializeAndDeserialize(state); Assert.That(result, Is.Not.Null); Assert.That(result.OriginalOppositeEndPoints, Is.Not.Null); Assert.That(result.OriginalOppositeEndPoints, Is.Not.Empty); Assert.That(result.EndPointLoader, Is.Not.Null); Assert.That(result.DataManagerFactory, Is.Not.Null); }
public void FlattenedSerializable() { var endPointLoader = new SerializableVirtualEndPointLoaderFake < ICollectionEndPoint, ReadOnlyCollectionDataDecorator, ICollectionEndPointDataManager, ICollectionEndPointLoadState> (); var dataManagerFactory = new SerializableCollectionEndPointDataManagerFactoryFake(); var state = new IncompleteCollectionEndPointLoadState(endPointLoader, dataManagerFactory); var oppositeEndPoint = new SerializableRealObjectEndPointFake(null, _relatedObject); state.RegisterOriginalOppositeEndPoint(_collectionEndPointMock, oppositeEndPoint); var result = FlattenedSerializer.SerializeAndDeserialize(state); Assert.That(result, Is.Not.Null); Assert.That(result.OriginalOppositeEndPoints, Is.Not.Null); Assert.That(result.OriginalOppositeEndPoints, Is.Not.Empty); Assert.That(result.EndPointLoader, Is.Not.Null); Assert.That(result.DataManagerFactory, Is.Not.Null); }
public void FlattenedSerializable() { var endPointLoader = new SerializableVirtualEndPointLoaderFake < IVirtualEndPoint <object>, object, IVirtualEndPointDataManager, IVirtualEndPointLoadState <IVirtualEndPoint <object>, object, IVirtualEndPointDataManager> >(); var state = new TestableIncompleteVirtualEndPointLoadState(endPointLoader); var oppositeEndPoint = new SerializableRealObjectEndPointFake( null, DomainObjectMother.CreateFakeObject <OrderTicket> (DomainObjectIDs.OrderTicket1)); state.RegisterOriginalOppositeEndPoint(_virtualEndPointMock, oppositeEndPoint); var result = FlattenedSerializer.SerializeAndDeserialize(state); Assert.That(result, Is.Not.Null); Assert.That(result.OriginalOppositeEndPoints, Is.Not.Null); Assert.That(result.OriginalOppositeEndPoints, Is.Not.Empty); Assert.That(result.EndPointLoader, Is.Not.Null); }