public void SetUp() { _uut = new RFidReader(); _receivedEventArgs = null; _uut.RFidChangedEvent += (o, args) => { _receivedEventArgs = args; }; }
public void Setup() { _rfidReader = Substitute.For <IRFidReader>(); _door = Substitute.For <IDoor>(); _fileLogger = Substitute.For <IFileLogger>(); _usbCharger = Substitute.For <IUsbCharger>(); _chargeControl = Substitute.For <IChargeControl>(); _consoleWriter = Substitute.For <IConsoleWriter>(); _uut = new StationControl(_door, _rfidReader, _chargeControl, _fileLogger, _consoleWriter); }
public StationControl(IDoor door, IRFidReader reader, IChargeControl chargeControl, IFileLogger fileLogger, IConsoleWriter consoleWriter) { _door = door; _reader = reader; _chargeControl = chargeControl; _filelogger = fileLogger; _consoleWriter = consoleWriter; _door.DoorChangedEvent += HandleDoorChangedEvent; //Sørger for at når der sker et event i døren, så kaldes event-handleren _door.LockChangedEvent += HandlelockChangedEvent; //Sørger for at når der sker et event i låsen, så kaldes event-handleren _reader.RFidChangedEvent += HandleRFidReaderchangedEvent; //Sørger for at når der sker et event i RFid readeren, så kaldes event-handleren }