Studio:Test Unit Template

From STRIDE Wiki
Jump to navigation Jump to search

Following is an example of NaturalDocs commenting on a test class. It should be used as a template for such commenting.

Please put NaturalDocs comments in .h files.

#pragma once
#include <srtest.h>

namespace Basic {
    /*
    Class: Constructors
    Demonstrates passing constructor arguments to a test unit
    */
    class Constructors {
    public:
        /*
        Constructor: Constructors
        Constructor that sets internal values

        Parameters:
            val_1 - first argument
            val_2 - second argument
        */
        Constructors(int val_1, int val_2);
        /*
        Function: TestValuePositive

        Tests whether both values passed to the constructor are positive (e.g. greater than zero)

        Returns:
            true if both values are positive, false otherwise
        */
        bool TestValuesPositive();
        /*
        Enum: CounterMode
        Example enumeration

        NORMAL - Causes the counter to increment normally.
        ODD    - Causes the counter to only increment in odd numbers.
        EVEN   - Causes the counter to only increment in even numbers.
        */
        enum Mode { NORMAL, ODD, EVEN };

        // Constant: szLINK_TO_TEST_SPEC
        // wiki link that gets put into the test suite description
        static const char* szLINK_TO_TEST_SPEC;
    private:
        int value_1;
        int value_2;
    };
}

#ifdef _SCL
#pragma scl_test_class(Basic::Constructors)
#endif