public void ReadDataRangesFromXmlDocument_2Assemblies_4Ranges()
        {

            string xml = string.Empty;
            xml += "<timestamps>";
            xml += string.Format("<timestamp value=\"20100101_203055\">");
            xml += string.Format("<assembly id=\"1\" cs=\"1000\" cov=\"70.5\"/>"); 
            xml += string.Format("<assembly id=\"2\" cs=\"200\" cov=\"80\"/>");
            xml += "</timestamp>";
            xml += string.Format("<timestamp value=\"20100101_203555\">");
            xml += string.Format("<assembly id=\"1\" cs=\"900\" cov=\"79.7\"/>"); 
            xml += string.Format("<assembly id=\"2\" cs=\"300\" cov=\"60\"/>");
            xml += "</timestamp>";
            xml += "</timestamps>";

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);

            DataRangeReader reader = new DataRangeReader();
            List<DataRange> ranges = reader.ReadDataRangesFromXmlDocument(doc);

            Assert.AreEqual(4, ranges.Count);


        }
示例#2
0
        private void DrawChartFromFile(string fileName)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(fileName);

            DataRangeReader reader = new DataRangeReader();
            List<DataRange> dataRanges = reader.ReadDataRangesFromXmlDocument(doc);

            List<DataRange> eventRanges = reader.ReadEventRangesFromXmlDocument(doc);

            _chart = ChartBuilder.CreateChart();
            ChartBuilder.FillChartRanges(dataRanges, _chart);

            ChartBuilder.FillChartRangesEvents(eventRanges, _chart);

            this.Controls.Add(_chart);

            ResizeChart();
        }