Inheritance: IModelChange
Ejemplo n.º 1
0
 public void SerializeChangeTransaction()
 {
     var sourceChange = new ElementDeletion(uri);
     var nestedChanges = new[] { new ListDeletion(uri, property, 0, 1) };
     var change = new ChangeTransaction(sourceChange, nestedChanges);
     SerializeAndAssert(change);
 }
Ejemplo n.º 2
0
        public void RecordListInsertionComposition()
        {
            var semaphore = new Semaphore { Signal = Signal.STOP };
            var rec = new ModelChangeRecorder();
            rec.Start(railway);

            railway.Semaphores.Insert(0, semaphore);

            var expected = new ChangeTransaction()
            {
                SourceChange = new ListInsertionComposition<ISemaphore>(railway.AbsoluteUri, "Semaphores", 0, new List<ISemaphore>() { semaphore }),
                NestedChanges = new List<IModelChange>() { new ElementCreation(semaphore) }
            };
            var actual = rec.GetModelChanges().Changes[0];
            Assert.AreEqual(expected, actual);
        }