Ejemplo n.º 1
0
        public void ParameterAccess_WriteProtectionUpdatedWhenDisposed_WriteProtectionChangedIsNotRaised(bool initialValue, bool updatedValue)
        {
            // arrange
            var access = new ParameterAccess
            {
                IsWriteProtected = initialValue,
            };

            access.Dispose();

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

            // assert
            Event.Monitor <ParameterWriteProtectionChangedEventArgs>(access, nameof(ParameterAccess.WriteProtectionChanged)).
            When(Act).AssertEventNotRaised();
        }
Ejemplo n.º 2
0
        public void ParameterAccess_HandlingUpdatedWhenDisposed_HandlingChangedIsNotRaised(ParameterHandling initialValue, ParameterHandling updatedValue)
        {
            // arrange
            var access = new ParameterAccess
            {
                Handling = initialValue,
            };

            access.Dispose();

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

            // assert
            Event.Monitor <ParameterHandlingChangedEventArgs>(access, nameof(ParameterAccess.HandlingChanged)).
            When(Act).AssertEventNotRaised();
        }