public void PowerPointApplication_SlideShowEventIsRaised_CallsHandlerWithCorrectObject(string expectedEventName, Type expectedParameterType, Action <EApplication_SinkHelper> action) { // Arrange var eventBinder = new TestableComObjectStub(); var connectionPoint = new ConnectionPointStub(); var events = new EApplication_SinkHelper(eventBinder, connectionPoint); // Act action(events); var actualParametersPassToEvent = eventBinder.LastRaisedEventParameters; // Assert Assert.AreEqual(expectedEventName, eventBinder.LastRaisedEventName); CollectionAssert.IsNotEmpty(actualParametersPassToEvent); var actualParameter1 = actualParametersPassToEvent[0]; Assert.IsInstanceOf(expectedParameterType, actualParameter1, $"Event '{expectedEventName}' parameter must be of type '{expectedParameterType.Name}'"); }
public void SlideShowBegin_EventRaised_CallsHandlerWithCorrectObject() { // Arrange var eventBinder = new TestableComObjectStub(); var connectionPoint = new ConnectionPointStub(); var events = new EApplication_SinkHelper(eventBinder, connectionPoint); var parameter1 = new FakeComObject(); // Act events.SlideShowBegin(parameter1); var actualParametersPassToEvent = eventBinder.LastRaisedEventParameters; // Assert Assert.AreEqual("SlideShowBegin", eventBinder.LastRaisedEventName); CollectionAssert.IsNotEmpty(actualParametersPassToEvent); var actualParameter1 = actualParametersPassToEvent[0]; Assert.IsInstanceOf <SlideShowWindow>(actualParameter1, "Event SlideShowBegin parameter must be of type SlideShowWindow."); }