public void DefaultValueIsSetAfterReset() { // Given a changed parameter with default value ModeParameter <int> parameter = new ModeParameter <int>("p1", 5); parameter.Value = 3; // When reset parameter.Reset(); // Then it is the default value again. Assert.AreEqual(5, parameter.Value); }
public void IsModifiedIsFalseOnReset() { // Given a bool parameter ModeParameter <bool> parameter = new ModeParameter <bool>("p1", false); parameter.Value = true; // When reset parameter.Reset(); // Then is modified is false Assert.IsFalse(parameter.IsModified); }
public void EventIsNotEmittedWhenDefaultValueIsSetOnReset() { // Given a changed parameter with listener ModeParameter <int> parameter = new ModeParameter <int>("p1", 5); parameter.Value = 5; bool wasCalled = false; parameter.ParameterModified += (sender, args) => { wasCalled = true; }; // When reset parameter.Reset(); // Then event was called Assert.IsFalse(wasCalled); }