예제 #1
0
        public void ShouldKeepDirtyCollectionDirtyAfterMergingClone()
        {
            using (var s = OpenSession())
            {
                using (s.BeginTransaction())
                {
                    s.Lock(storedParent, LockMode.None);
                    storedParent.ClearChildren();
                    Assert.IsTrue(s.IsDirty());

                    var loadedClone = storedParent.Clone();
                    s.Merge(loadedClone);
                    Assert.IsTrue(s.IsDirty());
                }
            }
        }
예제 #2
0
        public async Task ShouldKeepDirtyCollectionDirtyAfterMergingCloneAsync()
        {
            using (var s = OpenSession())
            {
                using (s.BeginTransaction())
                {
                    await(s.LockAsync(storedParent, LockMode.None));
                    storedParent.ClearChildren();
                    Assert.IsTrue(await(s.IsDirtyAsync()));

                    var loadedClone = storedParent.Clone();
                    await(s.MergeAsync(loadedClone));
                    Assert.IsTrue(await(s.IsDirtyAsync()));
                }
            }
        }