public void ApplyPropertyChangeAttribute() { var parent = railway.Routes.First().Entry; var newValue = Signal.FAILURE; var oldValue = repository.Resolve(parent.AbsoluteUri).GetType().GetProperty("Signal").GetValue(parent, null); var change = new AttributeChange { AffectedElement = parent, Feature = Semaphore.ClassInstance.LookupAttribute("signal"), OldValue = oldValue.ToString(), NewValue = newValue.ToString() }; change.Apply(); Assert.AreEqual(newValue, parent.Signal); }
public void InvertPropertyChangeAttribute() { var parent = railway1.Routes.First().Entry; var newValue = Signal.FAILURE; var oldValue = repository1.Resolve(parent.AbsoluteUri).GetType().GetProperty("Signal").GetValue(parent, null); var change = new AttributeChange { AffectedElement = parent, Feature = Semaphore.ClassInstance.Resolve(new Uri("signal", UriKind.Relative)) as ITypedElement, OldValue = oldValue.ToString(), NewValue = newValue.ToString() }; change.Apply(); foreach (var inverted in change.Invert()) { inverted.Apply(); } Assert.AreEqual(oldValue, parent.Signal); }