public void TestClassLevel()
 {
     using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE))
     {
         Assert.AreEqual(typeof(DiffReporter), Approvals.GetReporter().GetType());
     }
 }
Example #2
0
 public void TestMultipleReporters()
 {
     using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE))
     {
         Assert.AreEqual(typeof(MultiReporter), Approvals.GetReporter().GetType());
     }
 }
Example #3
0
 public void TestMethodOverrideWithSubMethod()
 {
     using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE))
     {
         SubMethod();
     }
 }
Example #4
0
 public void TestMethodOverride()
 {
     using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE))
     {
         Assert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType());
     }
 }
 public void TestExecutableSuccess()
 {
     using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE))
     {
         Approvals.VerifyAll(RunExecutableApproval(), "Increased feedback on");
     }
 }
Example #6
0
 private void AssertThrows <T>(TestDelegate code) where T : Exception
 {
     using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE))
     {
         Assert.Throws <T>(code);
     }
 }
Example #7
0
        public async Task TestAsyncMethodOverride()
        {
            await Task.Delay(1);

            using (Approvals.SetFrontLoadedReporter(ReportWithoutFrontLoading.INSTANCE))
            {
                Assert.AreEqual(typeof(MethodLevelReporter), Approvals.GetReporter().GetType());
            }
        }
Example #8
0
 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}();");
         }
     }
 }