public MetricResultBuilder()
 {
     _methodResult1 = new MethodResult("Test Method1",12,false);
     _methodResult2 = new MethodResult("Test Method2",5,true);
     _classResult1 = new ClassResult("Test Class 1", new List<MethodResult> {_methodResult1,_methodResult2});
     _classResult2 = new ClassResult("Test Class 1", new List<MethodResult> {_methodResult1,_methodResult2});
     _metricResult = new MetricResult("Test Metric", new List<ClassResult> {_classResult1,_classResult2});
 }
Exemple #2
0
        internal static XElement ConvertResult(ClassResult classResult)
        {
            var xElement = new XElement ("class", new XAttribute("name", classResult.Name));
            foreach (var methodResult in classResult.MethodResults)
            {
                var method = ConvertResult (methodResult);
                xElement.Add (method);
            }

            return xElement;
        }
 public void ConvertEmptyClassResult()
 {
     var classResult = new ClassResult ("XmlReport", new MethodResult[] {});
     var actual = XmlReport.ConvertResult (classResult);
     Assert.AreEqual (@"<class name=""XmlReport"" />", actual.ToString ());
 }