Get started - acadet/oscar GitHub Wiki

Oscar is really easy to use. Have a look at this short example:

class MyTestClass extends UnitTestClass {

    firstTest() : void {
        // ... AAA stuff
    }

    secondTest() : void {
        // ... another AAA stuff
    }
}

Some first points to note:

  • Your test class has to extend UnitTestClass.
  • Each method ended by test word is considered as a test method to run.

Alright, you have defined your first class. Now, how to launch it? It is also very simple:

var suite : TestSuite;
    
suite = new TestSuite();
suite.add(new MyTestClass());
suite.run();

Add each test class you want to run to your suite, then start engining. Oscar is able to launch every test you defined and creates a report.

Wonderful! From now on, you know how to deal with Oscar!