Ejemplo n.º 1
0
        public void OC_is_current_resolves()
        {
            var bfim = new OccEntity { Timestamp = _ts1, Name = "foo", Id = 1 };
            var cfim = new OccEntity { Timestamp = _ts1, Name = "bar", Id = 1 };
            var afim = new OccEntity { Timestamp = _ts1, Name = "baz", Id = 1 };

            var op = new MergeOperation<OccEntity>(bfim, cfim, afim);
            var result = op.Merge();

            Assert.IsTrue(result.IsResolved());
            Assert.AreEqual("foo", bfim.Name);
            Assert.AreEqual("bar", cfim.Name);
            Assert.AreEqual("baz", afim.Name);

            Assert.AreEqual(_ts1, bfim.Timestamp);
            Assert.AreEqual(_ts1, cfim.Timestamp);
            Assert.AreEqual(_ts1, afim.Timestamp);
        }
Ejemplo n.º 2
0
        public void OC_create_resolves()
        {
            OccEntity bfim = null;
            var cfim = new OccEntity { Timestamp = _ts1, Name = "bar", Id = 1 };
            var afim = new OccEntity { Timestamp = _ts2, Name = "baz", Id = 1 };

            var op = new MergeOperation<OccEntity>(bfim, cfim, afim);
            var result = op.Merge();

            Assert.IsTrue(result.IsResolved());
            Assert.AreEqual(afim, op.AFIM);
            Assert.AreEqual("bar", cfim.Name);
            Assert.AreEqual("baz", afim.Name);

            Assert.AreEqual(_ts1, cfim.Timestamp);
            Assert.AreEqual(_ts2, afim.Timestamp);
        }