示例#1
0
        public void ChargerEvent_ChargeIsConnectedFalse_PrintConnectionFailCalledOnDisplay()
        {
            //Arrange
            ChargerConnectionValue args0 = new ChargerConnectionValue {
                ChargerConnected = false
            };

            _chargeControlSource.ChargerConnectionValueEvent += Raise.EventWith(args0);

            DoorValueEventArgs args1 = new DoorValueEventArgs {
                DoorOpen = false
            };

            _doorSource.DoorValueEvent += Raise.EventWith(args1);

            RFIDDetectedEventArgs args2 = new RFIDDetectedEventArgs {
                RFID = 54321
            };

            _RfidReader.RFIDDetectedEvent += Raise.EventWith(args2);

            //Act

            //Assert
            _display.Received().PrintConnectionFail();
        }
示例#2
0
        public void ChargerEvent_ChargeIsConnectedTrue_StartChargeCalledOnChargeControl()
        {
            //Arrange
            ChargerConnectionValue args0 = new ChargerConnectionValue {
                ChargerConnected = true
            };

            _chargeControlSource.ChargerConnectionValueEvent += Raise.EventWith(args0);

            DoorValueEventArgs args1 = new DoorValueEventArgs {
                DoorOpen = false
            };

            _doorSource.DoorValueEvent += Raise.EventWith(args1);

            RFIDDetectedEventArgs args2 = new RFIDDetectedEventArgs {
                RFID = 54321
            };

            _RfidReader.RFIDDetectedEvent += Raise.EventWith(args2);

            //Act

            //Assert

            _chargeControlSource.Received().StartCharge();
        }
示例#3
0
        public void ChargerEvent_ChargeIsConnectedTrue_LogDoorLockedCalledOnLogfile()
        {
            //Arrange
            ChargerConnectionValue args0 = new ChargerConnectionValue {
                ChargerConnected = true
            };

            _chargeControlSource.ChargerConnectionValueEvent += Raise.EventWith(args0);

            DoorValueEventArgs args1 = new DoorValueEventArgs {
                DoorOpen = false
            };

            _doorSource.DoorValueEvent += Raise.EventWith(args1);

            RFIDDetectedEventArgs args2 = new RFIDDetectedEventArgs {
                RFID = 54321
            };

            _RfidReader.RFIDDetectedEvent += Raise.EventWith(args2);

            //Act

            //Assert
            _logFile.ReceivedWithAnyArgs().LogDoorLocked(default);
示例#4
0
 private void HandleDoorChangeEvent(object sender, DoorValueEventArgs e)
 {
     DoorState = e.DoorOpen;
     setLadeskabState();
 }