Пример #1
0
        public void OnlyScenariosWithTestWhouldBeIncludedOnReport()
        {
            //Given (Arrange)
            Project p = TestEnvironment.BuildMockProjectWithScenariosWithBothTestAndNoTest();
            string  scenarioTemplate   = TestEnvironment.MockPath + @"HtmlTestReport\ReportTemplates\Scenario.arepa";
            string  featureTemplate    = TestEnvironment.MockPath + @"HtmlTestReport\ReportTemplates\Feature.arepa";
            string  testReportTemplate = TestEnvironment.MockPath + @"HtmlTestReport\ReportTemplates\TestReport.arepa";

            //When (Act)
            Report r = new Report(p);

            r.PrepareReportContent(scenarioTemplate, featureTemplate, testReportTemplate);

            //Then (Assert)
            Assert.IsFalse(p.Error);
            foreach (Feature f in p.Features)
            {
                foreach (Scenario s in f.Scenarios)
                {
                    if (s.HasTest)
                    {
                        Assert.IsNotNull(s.ReportContent);
                    }
                    else
                    {
                        Assert.IsNull(s.ReportContent, "Scenarios without test are populated with a report content");
                    }
                }
            }
        }