コード例 #1
0
        public void AssertRaised_EventRaised_DoesNotInduceError()
        {
            var observable = new AsynchronousObservable();

            Action exercise = () => observable.Induce(true);

            EventMonitor.AssertRaised(
                exercise, handler => observable.Induced += handler);
        }
コード例 #2
0
        public void AssertRaised_EventNotRaised_InducesError()
        {
            var observable = new AsynchronousObservable();

            Action exercise = () => observable.Induce(false);

            Assert.Throws<EventMonitorException>(() => EventMonitor.AssertRaised(
                exercise, handler => observable.Induced += handler));
        }