예제 #1
0
        public void Raise_WithArguments_EventIsNull()
        {
            int expected = 10;

            var target = new SomeType();

            //Act
            target.Notify(expected);

            //Assert
            //Doesn't crash
        }
예제 #2
0
        public void Raise_WithArguments_EventNotNull()
        {
            object eventSender = null;
            int    eventId     = 0;
            int    expected    = 10;

            var target = new SomeType();

            target.SomeEvent += (o, e) => {
                eventSender = o;
                eventId     = e.Id;
            };

            //Act
            target.Notify(expected);

            //Assert
            eventSender.Should().Be(target);
            eventId.Should().Be(expected);
        }