public void ThorwExceptionWhen() { //Arrange var fixture = new Fixture(); var e = fixture.Build <FileSystemEventArgs>().Create(); var mockEventHandler = new Mock <IEventProcessor>(); var mockConfig = new Mock <IConfiguration>(); var mockLogger = new Mock <ILogger>(); mockConfig.Setup(c => c["source"]).Returns("Test"); mockConfig.Setup(c => c["destination"]).Returns("Test"); var eventHandler = new FlightEventHandler(mockEventHandler.Object, mockConfig.Object, mockLogger.Object); //Assert Assert.Throws <Exception>(() => eventHandler.OnCreated(new object(), e)); }
/// <summary> /// Register a function to be called when flight event occured. /// </summary> /// /// <param name="onFlightStart">The FlightEventHandler function registering the flight event.</param> public void RegisterToFlightStartEvent(FlightEventHandler onFlightStart) { _flightStartEvent += onFlightStart; }
/// <summary> /// Register a function to be called when FlightEvent rise. /// </summary> /// <param name="flightEvent">The FlightEventHandler function to be called on the event.</param> public void RegisterFlightEvent(FlightEventHandler flightEvent) { _flightEvent += flightEvent; }
/// <summary> /// Register a function to be called when the flight event occured. /// </summary> /// /// <param name="onFlightStart">The FlightEventHandler function registering the flight event.</param> public void RegisterToFlightEvent(FlightEventHandler onFlightEvent) { FlightEnterEvent += onFlightEvent; }
/// <summary> /// Register a function to be called when the flight event occured. /// </summary> /// /// <param name="onFlightStart">The FlightEventHandler function registering the flight event.</param> public void RegisterToFlightStartEvent(FlightEventHandler flightEnterEvent) { _stationsWaitingsManager.RegisterToFlightEvent(flightEnterEvent);; }