コード例 #1
0
 public void RequestEntry_DoorOpenedAndClosed_AlarmNotSounded()
 {
     _uut.RequestEntry("TFJ");
     _uut.DoorOpened();
     _uut.DoorClosed();
     Alarm.DidNotReceive().SoundAlarm();
 }
コード例 #2
0
        public void DoorOpened_GetValidIdAndCallDoorOpen_AlarmIsNotRaised()
        {
            _userValidation.ValidateEntryRequest(0).Returns(true);

            _uut.RequestEntry(0);
            _uut.DoorOpened();

            //Assert that
            _alarm.DidNotReceive().RaiseAlarm();
        }
コード例 #3
0
        public void DoorOpenedEventHandlerTest_DoorIsOpened_CloseDoorIsCalled()
        {
            // Arrange
            _userValidation.ValidateEntryRequest("test").ReturnsForAnyArgs(true);

            //Act
            _uut.RequestEntry("test");
            _door.DoorOpenedEvent += Raise.EventWith(new DoorOpenedEventArgs());

            //Assert
            _door.Received().Close();
            _alarm.DidNotReceive().SignalAlarm();
        }
コード例 #4
0
        public void DoorOpenedValidState_RaiseAlarmCalled(DoorControlState state, bool RaiseAlarmExpected)
        {
            _state.State = state;
            _UUT.DoorOpened();

            if (RaiseAlarmExpected)
            {
                _alarm.Received(1).RaiseAlarm();
            }
            else
            {
                _alarm.DidNotReceive().RaiseAlarm();
            }
        }
コード例 #5
0
 public void RequestEntry_InvalidId_Update_RaiseAlarm_notCalled()
 {
     _userValidation.ValidateEntryRequest(Arg.Any <string>()).Returns(false);
     _alarm.DidNotReceive().RaiseAlarm();
 }
コード例 #6
0
 public void RequestEntry_CardDbDeniesEntryRequest_AlarmNotSounded()
 {
     _uut.RequestEntry("TFJ");
     Alarm.DidNotReceive().SoundAlarm();
 }