public TestReportGraphData GenerateData(TestRunsDatabase testRunsDatabase)
        {
            TestReportGraphData graphData = new TestReportGraphData("user stories", "UserStoriesHistoyGraph.png");

            graphData.AddSeries("successful", "#75FF47");
            graphData.AddSeries("failed", "#FF6B90");
            graphData.AddSeries("not implemented", "#FFFCA8");

            foreach (TestRun testRun in testRunsDatabase.TestRuns)
            {
                graphData.AddDataValue("successful", testRun.UserStoriesSuccess);
                graphData.AddDataValue("failed", testRun.UserStoriesFail);
                graphData.AddDataValue("not implemented", testRun.UserStoriesNotImplemented);
            }

            return(graphData);
        }
Ejemplo n.º 2
0
        public void Test()
        {
            HtmlTestReportGeneratorSettings settings  = new HtmlTestReportGeneratorSettings("Test project");
            TestReportGraphData             graphData = new TestReportGraphData("test graph", "TestGraph2.png");

            graphData.AddSeries("successful", "#75FF47");
            graphData.AddSeries("failed", "#FF6B90");
            graphData.AddSeries("not implemented", "#FFFCA8");

            Random rnd = new Random();

            for (int i = 0; i < 100; i++)
            {
                graphData.AddDataValue("successful", rnd.Next(100));
                graphData.AddDataValue("failed", rnd.Next(20));
                graphData.AddDataValue("not implemented", rnd.Next(5));
            }

            ITestReportGraphGenerator graphGenerator = new DefaultTestReportGraphGenerator();

            graphGenerator.GenerateGraph(graphData, settings);
        }