public void IncCounters(ScenarioResult result)
 {
     if (result == null)
     {
         throw new ArgumentNullException("result can't be null");
     }
     if (result.TotalCount == 0)
     {
         PassCount++;
     }
     else
     {
         PassCount += result.PassCount;
     }
     if (!result._type)
     {
         Comments = result.Comments;
         if (result.TotalCount == 0)
         {
             FailCount++;
         }
         else
         {
             FailCount += result.FailCount;
         }
     }
 }
Ejemplo n.º 2
0
 public virtual void EndScenario(ScenarioResult result) {
     ResultsBlock(Result, result);
     if (result == ScenarioResult.Pass)
         tcr.PassCount++;
     else {
         tcr.FailCount++;
         if (result.Comments != null)
             tcr.Comments = result.Comments;
     }
     CloseTag();
 }
Ejemplo n.º 3
0
 protected virtual bool ExecuteScenario(MethodInfo mi)
 {
     String sTestDesc;
     sTestDesc = mi.Name ;
     WriteLine("");
     log.StartScenario(sTestDesc);
     ScenarioResult testResult = InvokeMethod(mi);
     if ( (object)testResult == null )
         testResult = new ScenarioResult(false, "***Test returned null ScenarioResult!***");
     log.EndScenario(testResult);
     return (testResult == ScenarioResult.Pass);
 }
Ejemplo n.º 4
0
 private void ResultsBlock(string tagName, ScenarioResult sr)
 {
     if (sr.Comments == null)
     {
         WriteTag(tagName, true, null, sr.GetResultLogAttributes());
     }
     else
     {
         WriteTag(tagName, false, null, sr.GetResultLogAttributes());
         WriteTag(ResultComments, true, sr.Comments, null);
         CloseTag();
     }
 }
Ejemplo n.º 5
0
 public virtual void EndScenario(ScenarioResult result)
 {
     ResultsBlock(Result, result);
     if (result == ScenarioResult.Pass)
     {
         tcr.PassCount++;
     }
     else
     {
         tcr.FailCount++;
         if (result.Comments != null)
         {
             tcr.Comments = result.Comments;
         }
     }
     CloseTag();
 }
Ejemplo n.º 6
0
 private ScenarioResult InvokeMethod(MethodInfo mi)
 {
     ScenarioResult sr = new ScenarioResult(false,
             "ScenarioResult was not set in FAXQATestBase.InvokeMethod()");
     try
     {
         try {
             sr = (ScenarioResult)(mi.Invoke(this, null));
         }
         finally {
         }
         if ((object)sr == (object)ScenarioResult.Fail)
             sr = new ScenarioResult(false);
         if ((sr == ScenarioResult.Fail) && (sr.Comments == null))
             sr.Comments = mi.Name + " FAILED";
     }
     catch(Exception ex)
     {
         sr = new ScenarioResult(false, mi.Name + " excepted: ");
         if (ex is TargetInvocationException)
             ex = ((TargetInvocationException)ex).InnerException;
         sr.Comments = sr.Comments + ex.GetType().ToString() + ": " + ex.Message;
         WriteLine(sr.Comments + "\r\n" + ex.StackTrace);
     }
     return sr;
 }
Ejemplo n.º 7
0
 private void ResultsBlock(string tagName, ScenarioResult sr) {
     if ( sr.Comments == null )
         WriteTag(tagName, true, null, sr.GetResultLogAttributes());
     else {
         WriteTag(tagName, false, null, sr.GetResultLogAttributes());
             WriteTag(ResultComments, true, sr.Comments, null);
         CloseTag();
     }
 }
Ejemplo n.º 8
0
 public void IncCounters(ScenarioResult result) {
     if ( result == null )
         throw new ArgumentNullException("result can't be null");
     if ( result.TotalCount == 0 )
         PassCount++;
     else
         PassCount += result.PassCount;
     if ( !result._type ) {                  
         Comments = result.Comments;
         if ( result.TotalCount == 0 )
             FailCount++;
         else
             FailCount += result.FailCount;
     }
 }