public ConePadTest(ITestName name, ConeTestMethod test, object[] args, IConeAttributeProvider attributes) { this.name = name; this.args = args; this.attributes = attributes; this.test = test; }
public ConeTestFailure(ITestName testName, Exception error, FailureType failureType) { TestName = testName.Name; Context = testName.Context; FailureType = failureType; var testError = Unwrap(error); StackFrames = GetNestedStackFrames(testError) .Where(ShouldIncludeFrame) .Select(x => new ConeStackFrame(x)) .ToArray(); var expectationFailed = testError as CheckFailed; if(expectationFailed != null) Errors = expectationFailed.Failures.ToArray(); else Errors = new [] { new FailedExpectation(testError.Message) }; }
public ConeTestFailure(ITestName testName, Exception error, FailureType failureType, Func<StackFrame, bool> includeFrame) { TestName = testName.Name; Context = testName.Context; FailureType = failureType; var testError = Unwrap(error); StackFrames = GetNestedStackFrames(testError) .Where(includeFrame) .Select(x => new ConeStackFrame(x)) .ToArray(); var expectationFailed = testError as CheckFailed; if(expectationFailed != null) { ErrorsContext = expectationFailed.Context; Errors = expectationFailed.Failures; } else { ErrorsContext = string.Empty; Errors = new [] { new FailedExpectation(testError.Message) }; } }
IConeTest NewTest(ITestName displayName, ConeMethodThunk thunk, object[] args, ExpectedTestResult result) { return new ConePadTest(displayName, NewTestMethod(fixture, thunk.Method, result), args, thunk); }
void AddTest(ITestName displayName, ConeMethodThunk thunk, object[] args, ExpectedTestResult result) { tests.Add(NewTest(displayName, thunk, args, result)); }
public ConeTestFailure(ITestName testName, Exception error, FailureType failureType) : this(testName, error, failureType, ShouldIncludeFrame) { }
public static ConeTestName From(ITestName testName) { return new ConeTestName(testName.Context, testName.Name); }