Exemplo n.º 1
0
        public void AssertionFailsIfAnExceptionIsThrownCustom()
        {
            var thing = new EventMocker();

            Assert.ThrowsException <InvalidOperationException>(() =>
                                                               AssertExtension.DoesNotTriggerEvent <EventMocker.CustomEventArgs>(x => thing.SomeTypedEvent += x, () => thing.ThrowException()));
        }
Exemplo n.º 2
0
        public void AssertionFailsIfEventIsTriggered()
        {
            var thing = new EventMocker();

            Assert.ThrowsException <AssertFailedException>(() =>
                                                           AssertExtension.DoesNotTriggerEvent(x => thing.SomeEvent += x, () => thing.TriggerEvent()));
        }
Exemplo n.º 3
0
        public void AssertionSucceedsIfCustomEventDoesNotTrigger()
        {
            var thing = new EventMocker();


            AssertExtension.DoesNotTriggerEvent <EventMocker.CustomEventArgs>(x => thing.SomeTypedEvent += x, () => thing.SomethingUnrelated());
        }
Exemplo n.º 4
0
        public void AssertionSucceeedsIfEventDoesNotTrigger()
        {
            var thing = new EventMocker();


            AssertExtension.DoesNotTriggerEvent(x => thing.SomeEvent += x, () => thing.SomethingUnrelated());
        }
Exemplo n.º 5
0
        public void AssertionFailsIfCustomEventDoesNotTrigger()
        {
            var thing = new EventMocker();

            Assert.ThrowsException <AssertFailedException>(() =>
                                                           AssertExtension.TriggersEvent <EventMocker.CustomEventArgs>(x => thing.SomeTypedEvent += x, () => thing.SomethingUnrelated()));
        }
Exemplo n.º 6
0
        public void AssertionFailsIfAnExceptionIsThrown()
        {
            var thing = new EventMocker();

            Assert.ThrowsException <InvalidOperationException>(() =>
                                                               AssertExtension.TriggersEvent(x => thing.SomeEvent += x, () => thing.ThrowException()));
        }
Exemplo n.º 7
0
        public void AssertionSucceedsIfCustomEventIsTriggered()
        {
            var thing = new EventMocker();

            AssertExtension.TriggersEvent <EventMocker.CustomEventArgs>(x => thing.SomeTypedEvent += x, () => thing.TriggerTypedEvent());
        }
Exemplo n.º 8
0
        public void AssertionSucceedsIfEventIsTriggered()
        {
            var thing = new EventMocker();

            AssertExtension.TriggersEvent(x => thing.SomeEvent += x, () => thing.TriggerEvent());
        }