コード例 #1
0
		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);
		}
コード例 #2
0
		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);
		}
コード例 #3
0
		public UseReporterAttribute(params Type[] reporters)
		{
			Reporter = new MultiReporter(reporters.Select(r => (IApprovalFailureReporter)Activator.CreateInstance(r)));
		}
コード例 #4
0
 public UseReporterAttribute(params Type[] reporters)
 {
     Reporter = new MultiReporter(reporters.Select(r => (IApprovalFailureReporter)Activator.CreateInstance(r)));
 }
コード例 #5
0
 public UseReporterAttribute(params Type[] reporters)
 {
     Reporter = new MultiReporter(reporters.Select(LoadReporter));
 }