public void OnSpecificationEnd(SpecificationInfo specification, Machine.Specifications.Result result) { var test = new TestResult( "MSpec", _assembly, specification.ContainingType, DateTime.Now.Subtract(_start).TotalMilliseconds, specification.ContainingType, specification.ContainingType, getState(result.Status), getMessage(result.Exception)); test.AddStackLines(getStackLines(result.Exception)); _results.Add(test); if (_feedback != null) _feedback.TestFinished(test); }
private void onSpecificationEnd(object specification, object result) { var test = new TestResult( "MSpec", _assembly, specification.Get<string>("ContainingType"), DateTime.Now.Subtract(_start).TotalMilliseconds, specification.Get<string>("ContainingType"), specification.Get<string>("ContainingType"), getState(result.Get<object>("Status").ToString()), getMessage(result.Get<object>("Exception"))); test.AddStackLines(getStackLines(result.Get<object>("Exception"))); _results.Add(test); if (_feedback != null) _feedback.TestFinished(test); }
private TestResult BuildTestResult(RunResult res) { var message = BuildMessage(res); var state = res.Passed ? TestState.Passed : TestState.Failed; var result = new TestResult("SimpleTesting", res.FoundOnMemberInfo.DeclaringType.Assembly.FullName, res.FoundOnMemberInfo.DeclaringType.Name, 0, res.FoundOnMemberInfo.DeclaringType.FullName + "." + res.FoundOnMemberInfo.Name, res.Name, state, message ); if(state == TestState.Failed) { result.AddStackLines(getStackLines(res.Thrown)); } return result; }
private IEnumerable<TestResult> runAllTests(Assembly assembly) { TestResult failresult = null; IEnumerable<RunResult> results = null; try { results = SimpleRunner.RunAllInAssembly(assembly); } catch (Exception ex) { failresult = new TestResult(Identifier, assembly.FullName, "", 0, "Error while running tests", TestState.Panic, getMessage(ex) + Environment.NewLine + Environment.NewLine); failresult.AddStackLines(getStackLines(ex)); } if (failresult != null) { yield return failresult; } else { if (results == null) yield break; foreach (var res in results) { yield return BuildTestResult(res); } } }
private TestResult getResult(RunSettings settings, IGrouping<Type, MethodInfo> fixture, celer.Core.RunResult x) { var result = new TestResult(Identifier, settings.Assembly.Assembly, fixture.Key.FullName, x.MillisecondsSpent, fixture.Key.FullName + "." + x.Test.Name, getState(x), getMessage(x)); result.AddStackLines(getStackLines(x.Exception)); return result; }