AssertExcepections() 공개 메소드

public AssertExcepections ( int expectedNumberOfExceptions ) : void
expectedNumberOfExceptions int
리턴 void
        public void ErrorNotificationMananger_EndToEnd()
        {
            ConfigurableErrorNotifier testNotifier = new ConfigurableErrorNotifier();

            // Should not throw
            this.Notify();

            // Add notifier
            this.testSubject.AddNotifier(testNotifier);
            this.Notify();
            testNotifier.AssertExcepections(1);

            // Cleanup
            this.testSubject.RemoveNotifier(testNotifier);

            // Add same notifier multiple times (no op)
            this.testSubject.AddNotifier(testNotifier);
            testNotifier.Reset();
            this.Notify();
            testNotifier.AssertExcepections(1);

            // Remove single instance
            this.testSubject.RemoveNotifier(testNotifier);
            testNotifier.Reset();
            this.Notify();
            testNotifier.AssertExcepections(0);

            // Remove non existing instance
            this.testSubject.RemoveNotifier(testNotifier);
            testNotifier.Reset();
            this.Notify();
            testNotifier.AssertExcepections(0);
        }
        public void ErrorNotificationMananger_EndToEnd()
        {
            ConfigurableErrorNotifier testNotifier = new ConfigurableErrorNotifier();

            // Should not throw
            this.Notify();

            // Add notifier
            this.testSubject.AddNotifier(testNotifier);
            this.Notify();
            testNotifier.AssertExcepections(1);

            // Cleanup
            this.testSubject.RemoveNotifier(testNotifier);

            // Add same notifier multiple times (no op)
            this.testSubject.AddNotifier(testNotifier);
            testNotifier.Reset();
            this.Notify();
            testNotifier.AssertExcepections(1);

            // Remove single instance
            this.testSubject.RemoveNotifier(testNotifier);
            testNotifier.Reset();
            this.Notify();
            testNotifier.AssertExcepections(0);

            // Remove non existing instance
            this.testSubject.RemoveNotifier(testNotifier);
            testNotifier.Reset();
            this.Notify();
            testNotifier.AssertExcepections(0);
        }