public void CollectionItems_Unsynchronized_WithUnload()
        {
            SetDatabaseModifyable();

            var order = DomainObjectIDs.Order1.GetObject <Order> ();

            order.OrderItems.EnsureDataComplete();

            var orderItemID = RelationInconcsistenciesTestHelper.CreateObjectAndSetRelationInOtherTransaction <OrderItem, Order> (order.ID, (oi, o) => oi.Order = o);
            var orderItem   = orderItemID.GetObject <OrderItem>();
            var endPointID  = RelationEndPointID.Resolve(orderItem, oi => oi.Order);
            var endPoint    = (RealObjectEndPoint)TestableClientTransaction.DataManager.GetRelationEndPointWithoutLoading(endPointID);

            Assert.That(endPoint, Is.Not.Null);

            Assert.That(RealObjectEndPointTestHelper.GetSyncState(endPoint), Is.TypeOf(typeof(UnsynchronizedRealObjectEndPointSyncState)));

            UnloadService.UnloadVirtualEndPoint(TestableClientTransaction, orderItem.Order.OrderItems.AssociatedEndPointID);

            Assert.That(RealObjectEndPointTestHelper.GetSyncState(endPoint), Is.TypeOf(typeof(UnknownRealObjectEndPointSyncState)));

            order.OrderItems.EnsureDataComplete();

            Assert.That(RealObjectEndPointTestHelper.GetSyncState(endPoint), Is.TypeOf(typeof(SynchronizedRealObjectEndPointSyncState)));
        }
        public void SyncState()
        {
            var deserializedEndPoint = FlattenedSerializer.SerializeAndDeserialize(_endPoint);

            var syncState = RealObjectEndPointTestHelper.GetSyncState(deserializedEndPoint);

            Assert.That(syncState, Is.Not.Null);
            Assert.That(syncState.GetType(), Is.SameAs(RealObjectEndPointTestHelper.GetSyncState(_endPoint).GetType()));
        }
        public void CollectionItems_Synchronized_WithUnload()
        {
            var orderItem  = DomainObjectIDs.OrderItem1.GetObject <OrderItem>();
            var endPointID = RelationEndPointID.Resolve(orderItem, oi => oi.Order);
            var endPoint   = (RealObjectEndPoint)TestableClientTransaction.DataManager.GetRelationEndPointWithoutLoading(endPointID);

            Assert.That(endPoint, Is.Not.Null);

            Assert.That(RealObjectEndPointTestHelper.GetSyncState(endPoint), Is.TypeOf(typeof(UnknownRealObjectEndPointSyncState)));

            orderItem.Order.OrderItems.EnsureDataComplete();

            Assert.That(RealObjectEndPointTestHelper.GetSyncState(endPoint), Is.TypeOf(typeof(SynchronizedRealObjectEndPointSyncState)));

            UnloadService.UnloadVirtualEndPoint(TestableClientTransaction, orderItem.Order.OrderItems.AssociatedEndPointID);

            Assert.That(RealObjectEndPointTestHelper.GetSyncState(endPoint), Is.TypeOf(typeof(UnknownRealObjectEndPointSyncState)));
        }