Exemple #1
0
        public void ParameterAccess_WriteProtectionIsSetToSameValue_WriteProtectionChangedIsNotRaised(bool initialValue, bool updatedValue)
        {
            // arrange
            var access = new ParameterAccess
            {
                IsWriteProtected = initialValue,
            };

            // act
            void Act()
            {
                access.IsWriteProtected = updatedValue;
            }

            // assert
            Event.Monitor <ParameterWriteProtectionChangedEventArgs>(access, nameof(ParameterAccess.WriteProtectionChanged)).
            When(Act).AssertEventNotRaised();
        }
Exemple #2
0
        public void ParameterAccess_WriteProtectionIsUpdated_WriteProtectionChangedIsRaised(bool initialValue, bool updatedValue)
        {
            // arrange
            var access = new ParameterAccess
            {
                IsWriteProtected = initialValue,
            };

            // act
            void Act()
            {
                access.IsWriteProtected = updatedValue;
            }

            // assert
            Event.Monitor <ParameterWriteProtectionChangedEventArgs>(access, nameof(ParameterAccess.WriteProtectionChanged)).
            When(Act).AssertEventRaised().WithSender(access).WithArgument(x => x.IsWriteProtected, updatedValue);
        }
Exemple #3
0
        public void ParameterAccess_HandlingIsSetToSameValue_HandlingChangedIsNotRaised(ParameterHandling initialValue, ParameterHandling updatedValue)
        {
            // arrange
            var access = new ParameterAccess
            {
                Handling = initialValue,
            };

            // act
            void Act()
            {
                access.Handling = updatedValue;
            }

            // assert
            Event.Monitor <ParameterHandlingChangedEventArgs>(access, nameof(ParameterAccess.HandlingChanged)).
            When(Act).AssertEventNotRaised();
        }
Exemple #4
0
        public void ParameterAccess_HandlingIsUpdated_HandlingChangedIsRaised(ParameterHandling initialValue, ParameterHandling updatedValue)
        {
            // arrange
            var access = new ParameterAccess
            {
                Handling = initialValue,
            };

            // act
            void Act()
            {
                access.Handling = updatedValue;
            }

            // assert
            Event.Monitor <ParameterHandlingChangedEventArgs>(access, nameof(ParameterAccess.HandlingChanged)).
            When(Act).AssertEventRaised().WithSender(access).WithArgument(x => x.Handling, updatedValue);
        }
Exemple #5
0
        public void ParameterAccess_Initialized_WriteProtectionIsFalse()
        {
            var access = new ParameterAccess();

            Assert.AreEqual(access.IsWriteProtected, false);
        }
Exemple #6
0
        public void ParameterAccess_Initialized_HandlingIsReadWrite()
        {
            var access = new ParameterAccess();

            Assert.AreEqual(access.Handling, ParameterHandling.ReadWrite);
        }