예제 #1
0
        public void Invoke_Fails_InvalidEvent()
        {
            // => Arrange
            var receiver = new TestEventReceiver();

            // => Act
            Assert.Throws <InvalidEventTypeException>(() => receiver.Invoke(new WrongTestEvent()));

            // => Assert
            Assert.Empty(receiver.ReceivedEvents);
        }
예제 #2
0
        public void Invoke_Success()
        {
            // => Arrange
            var receiver = new TestEventReceiver();

            // => Act
            receiver.Invoke(new TestEvent {
                Name = "NyghtX"
            });

            // => Assert
            Assert.Single(receiver.ReceivedEvents);
            Assert.Equal("NyghtX", receiver.ReceivedEvents.First().Name);
        }