public void ApplyListClear() { var change = new ListDeletion(railway.AbsoluteUri, "Semaphores", 0, int.MaxValue); change.Apply(repository); Assert.AreEqual(0, railway.Semaphores.Count); }
public void ApplyListDeletion() { var toDelete = railway.Routes.Take(1).ToList(); var change = new ListDeletion(railway.AbsoluteUri, "Routes", 0, 1); change.Apply(repository); Assert.AreNotEqual(toDelete, railway.Routes.FirstOrDefault()); CollectionAssert.DoesNotContain(railway.Routes.ToList(), toDelete); }
public void RecordListDeletion() { var rec = new ModelChangeRecorder(); rec.Start(railway); railway.Semaphores.RemoveAt(0); var expected = new ListDeletion(railway.AbsoluteUri, "Semaphores", 0, 1); var actual = ((ChangeTransaction)rec.GetModelChanges().Changes[0]).SourceChange; Assert.AreEqual(expected, actual); }
public void RecordListClear() { var parent = railway.Routes[0].DefinedBy[0].Elements[0]; var rec = new ModelChangeRecorder(); rec.Start(railway); parent.ConnectsTo.Clear(); var expected = new ListDeletion(parent.AbsoluteUri, "ConnectsTo", 0, int.MaxValue); var actual = rec.GetModelChanges().Changes[0]; Assert.AreEqual(expected, actual); }
public void SerializeListDeletion() { var change = new ListDeletion(uri, property, 42, 23); SerializeAndAssert(change); }