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(); }
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); }
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(); }
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); }
public void ParameterAccess_Initialized_WriteProtectionIsFalse() { var access = new ParameterAccess(); Assert.AreEqual(access.IsWriteProtected, false); }
public void ParameterAccess_Initialized_HandlingIsReadWrite() { var access = new ParameterAccess(); Assert.AreEqual(access.Handling, ParameterHandling.ReadWrite); }