コード例 #1
0
        public void AssertionSucceeedsIfEventDoesNotTrigger()
        {
            var thing = new EventMocker();


            AssertExtension.DoesNotTriggerEvent(x => thing.SomeEvent += x, () => thing.SomethingUnrelated());
        }
コード例 #2
0
        public void AssertionSucceedsIfCustomEventDoesNotTrigger()
        {
            var thing = new EventMocker();


            AssertExtension.DoesNotTriggerEvent <EventMocker.CustomEventArgs>(x => thing.SomeTypedEvent += x, () => thing.SomethingUnrelated());
        }
コード例 #3
0
        public void AssertionFailsIfEventDoesNotTrigger()
        {
            var thing = new EventMocker();

            Assert.ThrowsException <AssertFailedException>(() =>
                                                           AssertExtension.TriggersEvent(x => thing.SomeEvent += x, () => thing.SomethingUnrelated()));
        }