Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }