public void ctor_LegalValue_InitializeFields()
 {
     CombinedDataEntry target = new CombinedDataEntry(_Method, 1, 2);
     Assert.AreEqual(1, target.CoverageData);
     Assert.AreEqual(2, target.CyclomaticComplexity);
     Assert.AreEqual(_Method, target.Method);
 }
 public void Equals_DifferentMethod_ReturnFalse()
 {
     var otherMethod = new MethodSignature(VALID_TYPE_NAME, VALID_METHOD_NAME+"a");
     var target1 = new CombinedDataEntry(_Method, 1, 5);
     var target2 = new CombinedDataEntry(otherMethod, 1, 5);
     Assert.IsFalse(target1.Equals(target2));
 }
예제 #3
0
 private static IList<CombinedDataEntry> Join(IList<CoverageDataEntry> coverageData, IList<CCDataEntry> ccData)
 {
     var results = new List<CombinedDataEntry>();
     foreach (var item in coverageData)
     {
         var ccEntry = LocateCCData(item.Method, ccData);
         if (null != ccEntry)
         {
             var CombinedData = new CombinedDataEntry(item.Method, item.CoverageData, ccEntry.CyclomaticComplexity);
             results.Add(CombinedData);
         }
         //else
         //{
         //    Console.WriteLine("Didnt Find MEthod: {0}.{1}", item.Method.TypeName, item.Method.MethodName);
         //}
     }
     return results;
 }
 public void Equals_NullValue_ReturnFalse()
 {
     CombinedDataEntry target = new CombinedDataEntry(_Method, 1,5);
     bool actual = target.Equals(null);
     Assert.IsFalse(actual);
 }
 public void Equals_IdenticalValues_ReturnTrue()
 {
     var target1 = new CombinedDataEntry(_Method, 1, 5);
     var target2 = new CombinedDataEntry(_Method, 1, 5);
     Assert.IsTrue(target1.Equals(target2));
 }
 public void Equals_DifferentCoverageValue_ReturnFalse()
 {
     CombinedDataEntry target1 = new CombinedDataEntry(_Method, 1, 0);
     CombinedDataEntry target2 = new CombinedDataEntry(_Method, 2, 0);
     Assert.IsFalse(target1.Equals(target2));
 }
 public void Equals_DifferentCCValue_ReturnFalse()
 {
     CombinedDataEntry target1 = new CombinedDataEntry(_Method, 5, 1);
     CombinedDataEntry target2 = new CombinedDataEntry(_Method, 5, 2);
     Assert.IsFalse(target1.Equals(target2));
 }
 public void ctor_TooBigCoverageValue_ThrowsException()
 {
     CombinedDataEntry target = new CombinedDataEntry(_Method, -1, 200);
 }
 public void ctor_NegativeCoverageValue_ThrowsException()
 {
     CombinedDataEntry target = new CombinedDataEntry(_Method, -1, 5);
 }
 public void ctor_NegativeCCValue_ThrowsException()
 {
     CombinedDataEntry target = new CombinedDataEntry(_Method, 5, -1);
 }