Наследование: BaseChartBuilder
 protected override Chart[] HandleResults(IEnumerable<RequestDataResults> results)
 {
     var builder = new ChartBuilder();
     var stream = new MemoryStream();
     builder.Generate(stream, results);
     return new[] { new Chart { Data = stream.GetBuffer(), Name = string.Empty}};
 }
Пример #2
0
        public void TestGenerateShouldReturnImage()
        {
            var chartBuilder = new ChartBuilder();
            var stream = new MemoryStream();
            var dataResults = new List<RequestDataResults>();
            int count = 3;
            for (int i = 0; i < count;i++ )
            {
                dataResults.Add(new RequestDataResults() { AverageResponseTime = 100 * i, Date = DateTime.Now, Request = "Request" + i });
            }

            chartBuilder.Generate(stream, dataResults);
            Assert.That(stream.Length > 0);
        }