public void TestCallAFterException()
		{
			var a = new NUnitReporter();
			var b = new RecordingReporter();
			var multi = new MultiReporter(a, b);
			var exception = ExceptionUtilities.GetException(() => multi.Report("a", "r"));
			Assert.AreEqual("a,r", b.CalledWith);
			Assert.IsInstanceOf<Exception>(exception);
		}
		public void TestMultiReporter()
		{
			var a = new RecordingReporter();
			var b = new RecordingReporter();
			var multi = new MultiReporter(a, b);
			multi.Report("a", "r");
			Assert.AreEqual("a,r", a.CalledWith);
			Assert.AreEqual("a,r", b.CalledWith);
		}
        public void TestCallAfterException()
        {
            var a         = new NUnitReporter();
            var b         = new RecordingReporter();
            var multi     = new MultiReporter(a, b);
            var exception = ExceptionUtilities.GetException(() => multi.Report("a", "r"));

            Assert.AreEqual("a,r", b.CalledWith);
            Assert.IsInstanceOf <Exception>(exception);
        }
        public void TestMultiReporter()
        {
            var a     = new RecordingReporter();
            var b     = new RecordingReporter();
            var multi = new MultiReporter(a, b);

            multi.Report("a", "r");
            Assert.AreEqual("a,r", a.CalledWith);
            Assert.AreEqual("a,r", b.CalledWith);
        }
        public void TestCallsFirstAndOnlyFirst()
        {
            var a = new RecordingReporter(false);
            var b = new RecordingReporter(true);
            var c = new RecordingReporter(true);

            var reporter = new FirstWorkingReporter(a,b,c);
            Assert.IsTrue(reporter.IsWorkingInThisEnvironment());
            reporter.Report("a","b");
            Assert.IsNull(a.CalledWith);
            Assert.AreEqual("a,b", b.CalledWith);
            Assert.IsNull(c.CalledWith);
        }
        public void TestCallsFirstAndOnlyFirst()
        {
            var a = new RecordingReporter(false);
            var b = new RecordingReporter(true);
            var c = new RecordingReporter(true);

            var reporter = new FirstWorkingReporter(a, b, c);

            Assert.IsTrue(reporter.IsWorkingInThisEnvironment("default.txt"));
            reporter.Report("a", "b");
            Assert.IsNull(a.CalledWith);
            Assert.AreEqual("a,b", b.CalledWith);
            Assert.IsNull(c.CalledWith);
        }