private void Store(PartialCollectionReplicationTestCase.Data root, int depth)
        {
            IExtObjectContainer container = ContainerFor(A());

            container.Ext().Store(root, depth);
            container.Commit();
        }
        public virtual void TestCollectionUpdateDoesNotTouchExistingElements()
        {
            PartialCollectionReplicationTestCase.Data root = new PartialCollectionReplicationTestCase.Data
                                                                 ("root");
            PartialCollectionReplicationTestCase.Data c1 = new PartialCollectionReplicationTestCase.Data
                                                               ("c1");
            PartialCollectionReplicationTestCase.Data c2 = new PartialCollectionReplicationTestCase.Data
                                                               ("c2");
            root.Add(c1);
            root.Add(c2);
            Store(root, 1);
            long c1Version = VersionFor(c1);
            long c2Version = VersionFor(c2);

            PartialCollectionReplicationTestCase.Data c3 = new PartialCollectionReplicationTestCase.Data
                                                               ("c3");
            root.Add(c3);
            Store(root, 2);
            Assert.IsGreater(0, VersionFor(c3));
            Assert.AreEqual(c1Version, VersionFor(c1));
            Assert.AreEqual(c2Version, VersionFor(c2));
        }
		public virtual void TestNoReplicationForUntouchedElements()
		{
			PartialCollectionReplicationTestCase.Data root = new PartialCollectionReplicationTestCase.Data
				("root");
			PartialCollectionReplicationTestCase.Data c1 = new PartialCollectionReplicationTestCase.Data
				("c1");
			PartialCollectionReplicationTestCase.Data c2 = new PartialCollectionReplicationTestCase.Data
				("c2");
			root.Add(c1);
			root.Add(c2);
			Store(root, 1);
			IList<PartialCollectionReplicationTestCase.Data> created = ReplicateAllCapturingCreatedObjects
				();
			AssertData(created, "root", "c1", "c2");
			PartialCollectionReplicationTestCase.Data c3 = new PartialCollectionReplicationTestCase.Data
				("c3");
			root.Add(c3);
			Store(root, 2);
			c2.Id("c2*");
			c2.Add(new PartialCollectionReplicationTestCase.Data("c4"));
			IList<PartialCollectionReplicationTestCase.Data> updated = ReplicateAllCapturingUpdatedObjects
				();
		}
        public virtual void TestNoReplicationForUntouchedElements()
        {
            PartialCollectionReplicationTestCase.Data root = new PartialCollectionReplicationTestCase.Data
                                                                 ("root");
            PartialCollectionReplicationTestCase.Data c1 = new PartialCollectionReplicationTestCase.Data
                                                               ("c1");
            PartialCollectionReplicationTestCase.Data c2 = new PartialCollectionReplicationTestCase.Data
                                                               ("c2");
            root.Add(c1);
            root.Add(c2);
            Store(root, 1);
            IList <PartialCollectionReplicationTestCase.Data> created = ReplicateAllCapturingCreatedObjects
                                                                            ();

            AssertData(created, "root", "c1", "c2");
            PartialCollectionReplicationTestCase.Data c3 = new PartialCollectionReplicationTestCase.Data
                                                               ("c3");
            root.Add(c3);
            Store(root, 2);
            c2.Id("c2*");
            c2.Add(new PartialCollectionReplicationTestCase.Data("c4"));
            IList <PartialCollectionReplicationTestCase.Data> updated = ReplicateAllCapturingUpdatedObjects
                                                                            ();
        }
 public virtual void Add(PartialCollectionReplicationTestCase.Data data)
 {
     _children.Add(data);
 }
 private IObjectInfo ObjectInfoFor(PartialCollectionReplicationTestCase.Data c1)
 {
     return(ContainerFor(A()).Ext().GetObjectInfo(c1));
 }
 private long VersionFor(PartialCollectionReplicationTestCase.Data c1)
 {
     return(ObjectInfoFor(c1).GetCommitTimestamp());
 }
		public virtual void TestCollectionUpdateDoesNotTouchExistingElements()
		{
			PartialCollectionReplicationTestCase.Data root = new PartialCollectionReplicationTestCase.Data
				("root");
			PartialCollectionReplicationTestCase.Data c1 = new PartialCollectionReplicationTestCase.Data
				("c1");
			PartialCollectionReplicationTestCase.Data c2 = new PartialCollectionReplicationTestCase.Data
				("c2");
			root.Add(c1);
			root.Add(c2);
			Store(root, 1);
			long c1Version = VersionFor(c1);
			long c2Version = VersionFor(c2);
			PartialCollectionReplicationTestCase.Data c3 = new PartialCollectionReplicationTestCase.Data
				("c3");
			root.Add(c3);
			Store(root, 2);
			Assert.IsGreater(0, VersionFor(c3));
			Assert.AreEqual(c1Version, VersionFor(c1));
			Assert.AreEqual(c2Version, VersionFor(c2));
		}