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 UseReporterAttribute(params Type[] reporters) { Reporter = new MultiReporter(reporters.Select(r => (IApprovalFailureReporter)Activator.CreateInstance(r))); }
public UseReporterAttribute(params Type[] reporters) { Reporter = new MultiReporter(reporters.Select(LoadReporter)); }