Exemplo n.º 1
0
        public void MapStatCodeEWM(TestResult testResult)
        {
            foreach (var testCase in testResult.Stats)
            {
                if (_metadata == null)
                {
                    _metadata = GetMetadata();
                }

                var mapCode = _metadata.StatCodeDict.Find(s => s.TestName.Contains(testCase.StatName));
                if (mapCode == null) continue;
                foreach (var map in mapCode.Map)
                {
                    testCase.StatName = map.ID;
                }
            }
        }
Exemplo n.º 2
0
 public void AddValidationStat(XPathNavigator xpathnav, TestResult testResult, string valid, int total)
 {
     var validMsg = valid == "warn" ? "warning" : valid;
     var validationIDList = GetTestCaseIDListByValidation(xpathnav, validMsg, NamespaceMgr);
     var i = 0;
     if (validationIDList.Count == 0 || total == 0)
     {
         testResult.Stats.Add(new TestCase { StatName = valid, StatVal = "0" });
         return;
     }
     foreach (var varidateIds in validationIDList)
     {
         if (i == 0)
         {
             if (i == validationIDList.Count-1)
                 testResult.Stats.Add(new TestCase { StatName = valid, StatVal = total + "[" + varidateIds + "]" });
             else
                 testResult.Stats.Add(new TestCase { StatName = valid, StatVal = total + "[" + varidateIds });
         }
         else
         {
             if (i == validationIDList.Count-1)
                 testResult.Stats.Add(new TestCase { StatName = valid + "." + i, StatVal = varidateIds + "]" });
             else
                 testResult.Stats.Add(new TestCase { StatName = valid + "." + i, StatVal = varidateIds });
         }
         i++;
     }
 }