public void WriteOutExceptions(IAssertionHelper helper) { if (Setup.Any()) { helper.Log.WriteLine("Set Up Error:"); foreach (var exception in Setup) { helper.Log.Indent(); WriteOutFullExceptionHelper(helper, exception); helper.Log.UnIndent(); } } if (Test.Any()) { foreach (var exception in Test) { WriteOutFullExceptionHelper(helper, exception); } helper.Log.WriteLine(String.Empty); } if (Teardown.Any()) { helper.Log.WriteLine("Tear Down Error:"); foreach (var exception in Teardown) { helper.Log.Indent(); WriteOutFullExceptionHelper(helper, exception); helper.Log.UnIndent(); } } }
public ResultKind GetResult(IAssertionHelper helper) { if (Test.OfType <IgnoreException>().Any()) { return(ResultKind.Ignore); } if (Setup.Any() || Teardown.Any() || Test.Any(it => !(it is ResultException))) { return(ResultKind.Error); } if (Test.OfType <AssertionException>().Any()) { return(ResultKind.Fail); } if (!Assert._globalStyleUsed && helper.Assert.AssertCount == 0) { return(ResultKind.NoError); } return(ResultKind.Success); }
public Result(string platform, ResultKind kind, DateTime startTime, DateTime endTime, IAssertionHelper helper) { Platform = platform; Kind = kind; StartTime = startTime; EndTime = endTime; Output = helper.Log.ToString(); if (Assert._globalStyleUsed && helper.Assert.AssertCount == 0) AssertCount = -1; else AssertCount = helper.Assert.AssertCount; }
private void WriteOutFullExceptionHelper(IAssertionHelper helper, Exception ex) { if (ex is AssertionException) { helper.Log.WriteLine(ex.Message); helper.Log.WriteLine(ex.StackTrace); } else if (ex is IgnoreException) { helper.Log.Write(ex.Message); } else { helper.Log.Write("{0}: ", ex.GetType().Name); helper.Log.WriteLine(ex.Message); helper.Log.WriteLine(ex.StackTrace); if (ex.InnerException != null) { WriteOutFullExceptionHelper(helper, ex); } } }
private void WriteOutFullExceptionHelper(IAssertionHelper helper, Exception ex) { if (ex is AssertionException) { helper.Log.WriteLine(ex.Message); helper.Log.WriteLine(ex.StackTrace); } else if (ex is IgnoreException) { helper.Log.Write(ex.Message); } else { helper.Log.Write("{0}: ", ex.GetType().Name); helper.Log.WriteLine(ex.Message); helper.Log.WriteLine(ex.StackTrace); if (ex.InnerException != null) WriteOutFullExceptionHelper(helper, ex); } }
public ResultKind GetResult(IAssertionHelper helper) { if (Test.OfType<IgnoreException>().Any()) return ResultKind.Ignore; if(Setup.Any() || Teardown.Any() || Test.Any(it => !(it is ResultException))) return ResultKind.Error; if(Test.OfType<AssertionException>().Any()) return ResultKind.Fail; if (!Assert._globalStyleUsed && helper.Assert.AssertCount == 0) { return ResultKind.NoError; } return ResultKind.Success; }
public Result(string platform, ResultKind kind, DateTime startTime, DateTime endTime, IAssertionHelper helper) { Platform = platform; Kind = kind; StartTime = startTime; EndTime = endTime; Output = helper.Log.ToString(); if (Assert._globalStyleUsed && helper.Assert.AssertCount == 0) { AssertCount = -1; } else { AssertCount = helper.Assert.AssertCount; } }