2
// Copyright (C) 2002. James W. Newkirk, Michael C. Two, Alexei A. Vorontsov. All Rights Reserved.
7
using System.Diagnostics;
8
using System.Reflection;
11
/// Summary description for ExpectedExceptionTestCase.
13
public class ExpectedExceptionTestCase : TemplateTestCase
15
private Type expectedException;
17
public ExpectedExceptionTestCase(object fixture, MethodInfo info, Type expectedException)
20
this.expectedException = expectedException;
23
protected override internal void ProcessException(Exception exception, TestCaseResult testResult)
25
if (expectedException.Equals(exception.GetType()))
31
string message = "Expected: " + expectedException.Name + " but was " + exception.GetType().Name;
32
testResult.Failure(message, exception.StackTrace);
38
protected override internal void ProcessNoException(TestCaseResult testResult)
40
testResult.Failure(expectedException.Name + " was expected", null);