public static void When_I_set_an_ObservedProperty_on_an_ObservedReference() { var observingClass = new ObservingClass(); var observedClass = observingClass.ObservedReference; var propertiesThatChanged = observingClass.ObservePropertyChanges(); observedClass.ObservedProperty = 1.0M; observedClass.NonObservedProperty = 1.0M; "it should only notify once that the ObservingProperty and the ObservingCalulatedProperty on the ObservingClass has changed" .AssertThat(propertiesThatChanged, Is.EquivalentTo(new[] { "ObservingProperty", "ObservingCalculatedProperty" })); "it should update the backing field for the ObservedReference property" .AssertThat(observingClass.ObservingProperty, Is.EqualTo(observedClass.ObservedProperty)); }
public static void When_I_set_an_ObservedProperty_on_an_ObservedReference() { var observingClass = new ObservingClass(); var observedClass = observingClass.ObservedReference; var propertiesThatChanged = observingClass.ObservePropertyChanges(); observedClass.ObservedProperty = 1.0M; observedClass.NonObservedProperty = 1.0M; "it should only notify once that the ObservingProperty and the ObservingCalulatedProperty on the ObservingClass has changed" .AssertThat(propertiesThatChanged, Is.EquivalentTo(new[] { "ObservingProperty", "ObservingCalculatedProperty" })); "it should update the backing field for the ObservedReference property" .AssertThat(observingClass.ObservingProperty, Is.EqualTo(observedClass.ObservedProperty)); }