Frameworks/OJUnit/OJTestCase.j
Go to the documentation of this file.

    00001 @import <Foundation/Foundation.j>
    00002
    00003 @import "OJTestResult.j"
    00004 @import "OJAssert.j"
    00005
    00006 AssertionFailedError = "AssertionFailedError";
    00007
    00038 @implementation OJTestCase : CPObject
    00039 {
    00040     SEL                 _selector               @accessors(property=selector);
    00041 }
    00042
    00046 - (OJTestResult)run
    00047 {
    00048     var result = [OJTestResult createResult];
    00049     [self run:result];
    00050     return result;
    00051 }
    00052
    00057 - (void)run:(OJTestResult)result
    00058 {
    00059     [result run:self];
    00060 }
    00061
    00066 - (void)runBare
    00067 {
    00068     [self setUp];
    00069     try
    00070     {
    00071         [self runTest];
    00072     }
    00073     finally
    00074     {
    00075         [self tearDown];
    00076     }
    00077 }
    00078
    00083 - (void)runTest
    00084 {
    00085     [OJAssert assertNotNull:_selector];
    00086
    00087     [self performSelector:_selector];
    00088 }
    00089
    00093 - (void)setUp
    00094 {
    00095 }
    00096
    00100 - (void)tearDown
    00101 {
    00102 }
    00103
    00109 - (int)countTestCases
    00110 {
    00111     return 1;
    00112 }
    00113
    00114 - (CPString)description
    00115 {
    00116     return "[" + [self className] + " " + _selector + "]";
    00117 }
    00118
    00119 @end
    00120
    00121 @import "OJTestCase+Assert.j"

All Classes Files Functions Variables