Example #1
0
        public void Format(IXLWorksheet worksheet, ScenarioOutline scenarioOutline, ref int row)
        {
            int originalRow = row;

            worksheet.Cell(row++, "B").Value = scenarioOutline.Name;
            worksheet.Cell(row++, "C").Value = scenarioOutline.Description;

            var results = testResults.GetScenarioOutlineResult(scenarioOutline);

            if (configuration.HasTestResults && results.WasExecuted)
            {
                worksheet.Cell(originalRow, "B").Style.Fill.SetBackgroundColor(results.WasSuccessful
                                                                                   ? XLColor.AppleGreen
                                                                                   : XLColor.CandyAppleRed);
            }

            foreach (Step step in scenarioOutline.Steps)
            {
                excelStepFormatter.Format(worksheet, step, ref row);
            }

            row++;
            worksheet.Cell(row++, "B").Value = "Examples";
            excelTableFormatter.Format(worksheet, scenarioOutline.Example.TableArgument, ref row);
        }
        public void Format(IXLWorksheet worksheet, Scenario scenario, ref int row)
        {
            int originalRow = row;

            worksheet.Cell(row, "B").Style.Font.SetBold();
            worksheet.Cell(row++, "B").Value = scenario.Name;
            worksheet.Cell(row++, "C").Value = scenario.Description;

            var results = testResults.GetScenarioResult(scenario);

            if (configuration.HasTestResults && results.WasExecuted)
            {
                worksheet.Cell(originalRow, "B").Style.Fill.SetBackgroundColor(results.WasSuccessful
                                                                                   ? XLColor.AppleGreen
                                                                                   : XLColor.CandyAppleRed);
            }


            foreach (Step step in scenario.Steps)
            {
                excelStepFormatter.Format(worksheet, step, ref row);
            }
        }