Exemple #1
0
        public void ApplyPropertyChangeReference()
        {
            var parent   = railway.Routes[0];
            var newValue = railway.Semaphores[0];

            var change = new AssociationPropertyChange
            {
                AffectedElement = parent,
                Feature         = Route.ClassInstance.LookupReference("entry"),
                NewValue        = newValue
            };

            change.Apply();

            Assert.AreSame(newValue, parent.Entry);
        }
Exemple #2
0
        public void InvertPropertyChangeReference()
        {
            var parent   = railway1.Routes[0];
            var newValue = railway1.Semaphores[0];
            var oldValue = parent.Entry;

            var change = new AssociationPropertyChange
            {
                AffectedElement = parent,
                Feature         = Route.ClassInstance.LookupReference("entry"),
                OldValue        = oldValue,
                NewValue        = newValue
            };

            change.Apply();
            foreach (var inverted in change.Invert())
            {
                inverted.Apply();
            }

            Assert.AreSame(oldValue, parent.Entry);
        }