Inheritance: IModelChange
Example #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);
 }
Example #2
0
        public void ApplyElementDeletion()
        {
            var toDelete = railway.Semaphores[0];
            var change = new ElementDeletion(toDelete.AbsoluteUri);

            change.Apply(repository);

            CollectionAssert.DoesNotContain(railway.Semaphores.ToArray(), toDelete);
        }
Example #3
0
        public void RecordElementDeletion()
        {
            var toDelete = railway.Routes[0];
            var expected = new ElementDeletion(toDelete.AbsoluteUri);
            var rec = new ModelChangeRecorder();
            rec.Start(railway);

            toDelete.Delete();

            var actual = ((ChangeTransaction)rec.GetModelChanges().Changes[0]).SourceChange;
            Assert.AreEqual(expected, actual);
        }
Example #4
0
 public void SerializeElementDeletion()
 {
     var change = new ElementDeletion(uri);
     SerializeAndAssert(change);
 }