public TypeResult ProcessType(TypeDefinition type, MethodResult[] methodResults)
 {
     TypeResult result = new TypeResult(type.Name);
     result.MethodResults = methodResults;
     result.Result = methodResults.Sum(r => r.Result);
     return result;
 }
 public MethodResult ProcessMethod(MethodDefinition methodDefinition)
 {
     MethodResult methodResult = new MethodResult();
     methodResult.MethodName = methodDefinition.FriendlyName();
     methodResult.Result = algorithm.Compute(methodDefinition.Body);
     return methodResult;
 }
 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});
 }
        protected override string addResult(MethodResult methodResult)
        {
            string result = string.Empty;
            //return @"<td id =""fail"">" + methodResult.Result + "</td>";
            result += _emptyColumn;
            result += "<td>" + HttpUtility.HtmlEncode(methodResult.Name) + "</td>";
            result += @"<td id =""fail"">" + methodResult.Result + "</td>";
            result += "</tr>";

            return result;
        }
示例#5
0
        protected virtual string addResult(MethodResult methodResult)
        {
            string result = string.Empty;

            result += _emptyColumn;
            result += "<td>" + HttpUtility.HtmlEncode(methodResult.Name) + "</td>";

            if (methodResult.Pass)
                result += @"<td id =""pass"">" + methodResult.Result + "</td>";
            else
                result += @"<td id =""fail"">" + methodResult.Result + "</td>";

            result += "</tr>";
            return result;
        }
示例#6
0
 internal static XElement ConvertResult(MethodResult methodResult)
 {
     var method = new XElement ("method",
         new XAttribute ("name", methodResult.Name),
         new XAttribute ("pass", methodResult.Pass),
         new XAttribute ("result", methodResult.Result)
     );
     return method;
 }
示例#7
0
 public void ConvertSimpleMethodResult()
 {
     var methodResult = new MethodResult ("ConvertResult", 12, true);
     var actual = XmlReport.ConvertResult (methodResult);
     Assert.AreEqual (@"<method name=""ConvertResult"" pass=""true"" result=""12"" />", actual.ToString ());
 }