~nunit-core/nunitv2/2.5

« back to all changes in this revision

Viewing changes to src/NUnitFramework/core/NormalTestCase.cs

  • Committer: jnewkirk
  • Date: 2002-07-10 20:00:13 UTC
  • Revision ID: vcs-imports@canonical.com-20020710200013-j8us5mbi0usp7p02
initialĀ load

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// Copyright (C) 2002. James W. Newkirk, Michael C. Two, Alexei A. Vorontsov. All Rights Reserved.
 
3
//
 
4
namespace Nunit.Core
 
5
{
 
6
        using System;
 
7
        using System.Reflection;
 
8
        using Nunit.Framework;
 
9
 
 
10
        /// <summary>
 
11
        /// Summary description for TestCase.
 
12
        /// </summary>
 
13
        public class NormalTestCase : TemplateTestCase
 
14
        {
 
15
                public NormalTestCase(object fixture, MethodInfo method) : base(fixture, method)
 
16
                {}
 
17
 
 
18
                protected internal override void ProcessNoException(TestCaseResult testResult)
 
19
                {
 
20
                        testResult.Success();
 
21
                }
 
22
                
 
23
                protected internal override void ProcessException(Exception exception, TestCaseResult testResult)
 
24
                {
 
25
                        if(exception.GetType().IsAssignableFrom(typeof(AssertionException)))
 
26
                        {
 
27
                                AssertionException error = (AssertionException)exception;
 
28
                                testResult.Failure(error.Message, error.StackTrace);
 
29
                        }
 
30
                        else
 
31
                        {
 
32
                                testResult.Failure(exception.Message, exception.StackTrace);
 
33
                        }
 
34
                }
 
35
        }
 
36
}
 
37