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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }