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(); }
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(); }
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);
private void HandleDoorChangeEvent(object sender, DoorValueEventArgs e) { DoorState = e.DoorOpen; setLadeskabState(); }