User Tools

Site Tools


unit_tests

This is an old revision of the document!


Implementing Unit Tests

For Mail2Voice Next, we introduced unit tests. They are based on the QTest Suite.

Each class of Mail2Voice must have its dedicated unit test class.

Example

Let's say we have a class named MyClass with the following header :

class MyClass
{
  public:
    MyClass(); // Constructor initializing some properties
    
    void increment(); // Add 1 to m_count
    void setText(const QString& text); // Set m_text to text
    
    int count(); // Returns current m_count value
    
  private:
    int m_count;
    QString m_text;
};
unit_tests.1473315338.txt.gz · Last modified: 2023/04/25 16:52 (external edit)