Example #1
0
        public void GetRevisionReturnsRevision()
        {
            var revision = new Revision();
            var table = new TestTable();
            table.Revision = revision;

            Revision revision1 = table.GetRevision();

            Assert.AreEqual(revision, revision1);
        }
Example #2
0
        public void CanUpdateChangeSet()
        {
            var slave = new TestTable();
            var changeSet = new ChangeSet();
            changeSet.Inserts = new[] {new Row(), new Row(), };
            changeSet.Updates = new[] { new Row(), new Row(), };
            changeSet.Deletes = new[] { new Row(), new Row(), };

            slave.Update(changeSet);

            Assert.AreEqual(changeSet.Inserts,slave.OnRetriveInserts);
            Assert.AreEqual(changeSet.Updates,slave.OnRetriveUpdates);
            Assert.AreEqual(changeSet.Deletes,slave.OnRetriveDeletes);
        }
Example #3
0
        public void CanGetChangeSet()
        {
            var updates = new []{new Row(),new Row()};
            var inserts = new []{new Row(),new Row()};
            var deletes = new []{new Row(),new Row()};
            var revision = new Revision();

            var master = new TestTable();
            master.OnRetriveInserts = inserts;
            master.OnRetriveUpdates = updates;
            master.OnRetriveDeletes = deletes;
            ChangeSet changes = master.GetChanges(revision);

            Assert.AreEqual(changes.Inserts, inserts);
            Assert.AreEqual(changes.Updates, updates);
            Assert.AreEqual(changes.Deletes, deletes);
        }
Example #4
0
        public void CanGetChangeSet()
        {
            var updates  = new [] { new Row(), new Row() };
            var inserts  = new [] { new Row(), new Row() };
            var deletes  = new [] { new Row(), new Row() };
            var revision = new Revision();

            var master = new TestTable();

            master.OnRetriveInserts = inserts;
            master.OnRetriveUpdates = updates;
            master.OnRetriveDeletes = deletes;
            ChangeSet changes = master.GetChanges(revision);


            Assert.AreEqual(changes.Inserts, inserts);
            Assert.AreEqual(changes.Updates, updates);
            Assert.AreEqual(changes.Deletes, deletes);
        }