public void RequestEntry_DoorOpenedAndClosed_AlarmNotSounded()
 {
     _uut.RequestEntry("TFJ");
     _uut.DoorOpened();
     _uut.DoorClosed();
     Alarm.DidNotReceive().SoundAlarm();
 }
        public void DoorOpened_GetValidIdAndCallDoorOpen_AlarmIsNotRaised()
        {
            _userValidation.ValidateEntryRequest(0).Returns(true);

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

            //Assert that
            _alarm.DidNotReceive().RaiseAlarm();
        }
        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();
        }
        public void DoorOpenedValidState_RaiseAlarmCalled(DoorControlState state, bool RaiseAlarmExpected)
        {
            _state.State = state;
            _UUT.DoorOpened();

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