Example #1
0
 public ConePadTest(ITestName name, ConeTestMethod test, object[] args, IConeAttributeProvider attributes)
 {
     this.name = name;
     this.args = args;
     this.attributes = attributes;
     this.test = test;
 }
Example #2
0
        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)
                };
        }
Example #3
0
		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) };
			}
		}
Example #4
0
 IConeTest NewTest(ITestName displayName, ConeMethodThunk thunk, object[] args, ExpectedTestResult result)
 {
     return new ConePadTest(displayName, NewTestMethod(fixture, thunk.Method, result), args, thunk);
 }
Example #5
0
 void AddTest(ITestName displayName, ConeMethodThunk thunk, object[] args, ExpectedTestResult result)
 {
     tests.Add(NewTest(displayName, thunk, args, result));
 }
Example #6
0
		public ConeTestFailure(ITestName testName, Exception error, FailureType failureType) : this(testName, error, failureType, ShouldIncludeFrame)
		{ }
Example #7
0
 public static ConeTestName From(ITestName testName)
 {
     return new ConeTestName(testName.Context, testName.Name);
 }