Exemplo n.º 1
0
        public async Task BaseEventHandler_HandleEvent_CallsGenericHandleEvent()
        {
            // Arrange
            BaseEventHandler handler = new TestHandler();

            // Act
            await handler.HandleEvent(null, null, null, new TestEvent1());

            // Assert
            Assert.IsTrue(((TestHandler)handler).HandleEventCalled);
        }
Exemplo n.º 2
0
        public async Task BaseEventHandler_HandleEvent_ThrowsException_MismatchedType()
        {
            // Assert
            await Assert.ThrowsExceptionAsync <ArgumentException>(async() =>
            {
                // Arrange
                BaseEventHandler handler = new TestHandler();

                // Act
                await handler.HandleEvent(null, null, null, new TestEvent2());
            });
        }