예제 #1
0
 public void TestGreenGraph()
 {
     Cons.log(DateTime.Now+" executing test for green graph");
     Initialize();
     chart = chart.ToggleGraph(chart.GoogleControl).ToggleGraph(chart.RevenueControl);
     chart.makeDictionary();
     var graphPath = chart.ParsePath(chart.EmployeesGraph);
     //var offset = chart.ParseOffset(chart.EmployeesGraph);
     chart.moveTo(chart.Graphs);
     chart.moveTo(graphPath[0][0], graphPath[0][1]);
     for (int i = 0; i < graphPath.Count - 1; i++)
     {
         int offsetX=(graphPath[i + 1][0] - graphPath[i][0])/2-1;
         chart.moveTo(offsetX, 0);
         var message = chart.GetEmployeeMessage();
         if (!chart.PositionCheck(message, graphPath[i][1]))
         {
             Cons.log("Position error at level " + message + "\nTest failed");
             throw new Exception();
         }
         Cons.log(message);
         chart.moveTo(graphPath[i + 1][0] - graphPath[i][0] - offsetX, graphPath[i + 1][1] - graphPath[i][1]);
     }
     Cons.log("Test passed");
     Clean();
 }