public void TestSingletonOnAllReporters() { var reporters = GetSingletonReporterTypes(); foreach (var r in reporters) { Assert.IsInstanceOf(r, UseReporterAttribute.GetSingleton(r)); } }
public void TestSingletonOnAllReporters() { var reporters = GetSingletonReporterTypes(); foreach (var r in reporters) { Assert.IsInstanceOf(r, UseReporterAttribute.GetSingleton(r), $"Please add\npublic static readonly {r.FullName} INSTANCE = new {r.FullName}();"); } }
private static void VerifyReporterAttribute(UseReporterAttribute attribute) { var reporter = (IEnvironmentAwareReporter)attribute.Reporter; var reportException = Assert.Throws <Exception>(() => reporter.Report("a.txt", "a.txt")); var isWorkingException = Assert.Throws <Exception>(() => reporter.IsWorkingInThisEnvironment("a.txt")); Approvals.Verify($@"{reportException.Message} {isWorkingException.Message}"); }
public void TestSingletonOnAllReporters() { using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE)) { var reporters = GetSingletonReporterTypes(); foreach (var r in reporters) { Assert.IsInstanceOf(r, UseReporterAttribute.GetSingleton(r), $"Please add\npublic static readonly {r.FullName} INSTANCE = new {r.FullName}();"); } } }
public void TestMultipleWithInvalidReporterShouldThrow() { var attribute = new UseReporterAttribute(typeof(ReporterTest), typeof(string)); VerifyReporterAttribute(attribute); }
public void TestInvalidReporterShouldThrow() { var attribute = new UseReporterAttribute(typeof(ReporterTest)); VerifyReporterAttribute(attribute); }