Ejemplo n.º 1
0
        public void EnsureTestCoverage()
        {
            SwaggerSpecRunner.RunTests(
                SwaggerPath("azure-report.json"), ExpectedPath("AzureReport"), generator: "Azure.CSharp");
            using (var client =
                       new AutoRestReportServiceForAzureClient(Fixture.Uri,
                                                               new TokenCredentials(Guid.NewGuid().ToString())))
            {
                var report = client.GetReport();
#if PORTABLE
                float totalTests = report.Count - 6;
#else
                // TODO: This is fudging some numbers. Fixing the actual problem is a priority.
                float totalTests = report.Count;
#endif
                float executedTests = report.Values.Count(v => v > 0);
                if (executedTests < totalTests)
                {
                    foreach (var r in report.Where(r => r.Value == 0))
                    {
                        _interceptor.Information(string.Format(CultureInfo.CurrentCulture,
                                                               "{0}/{1}", r.Key, r.Value));
                    }
                    _interceptor.Information(string.Format(CultureInfo.CurrentCulture,
                                                           "The test coverage for Azure is {0}/{1}",
                                                           executedTests, totalTests));
                    Assert.Equal(totalTests, executedTests);
                }
            }
        }
Ejemplo n.º 2
0
 public void EnsureTestCoverage()
 {
     using (var client =
                new AutoRestReportServiceForAzureClient(Fixture.Uri,
                                                        new TokenCredentials(Guid.NewGuid().ToString())))
     {
         var report = client.GetReport();
         // TODO: This is fudging some numbers. Fixing the actual problem is a priority.
         float totalTests    = report.Count - 11;
         float executedTests = report.Values.Count(v => v > 0);
         if (executedTests < totalTests)
         {
             foreach (var r in report.Where(r => r.Value == 0))
             {
                 _interceptor.Information(string.Format(CultureInfo.CurrentCulture,
                                                        "{0}/{1}", r.Key, r.Value));
             }
             _interceptor.Information(string.Format(CultureInfo.CurrentCulture,
                                                    "The test coverage for Azure is {0}/{1}",
                                                    executedTests, totalTests));
         }
     }
 }