Creating MUnit Test

In this section, you will learn how to use the MUnit test framework to create a new MUnit test. To get started with MUnit tests refer to the Test Case concept.

Preparing Magik project

  1. Create envrionment_manager project according to Basic tutorial chapter from Magik development user guide.
  2. Click File > New > New Module to open New Module wizard.

    New Module wizard

    In this dialog:

    Press Finish.

Preparing GIS session

  1. Start swaf session assigned to previously created project.

    Start GIS session action

  2. Load as_environment_manager module into the session.

    Load module action

Creating new test using New Test Case Wizard

  1. Click File > New > MUnit Test Case to start New Test Case wizard.

    New Test Case Wizard first page

    In this dialog:

    Press Next.

  2. Select methods to test.

    New Test Case Wizard second page

    In this dialog:

    Press Next.

  3. Add as_environment_var_test.magik file to load list.

    New Test Case Wizard third page

    Press Finish to create the test class.

  4. Activate Magik editor which contains test class source code.

    Test class source code

    In the editor:

Now you are ready to run your test.

Related concepts

Test Case

Related reference

New Test Case wizard