title: Testing my class with QTestLib
body: <p>I need to make some unit test for my school project in Qt and although I have read Qt tutorial on that I can't figure out how am I supposed to write such tests. All of tests shown in tutorial I've mentioned refer to built-in methods. How should I write a unit test for a custom class say this is the simplest class I have:</p>
  
  <p>task.h</p>
  
  <pre><code>#ifndef TASK_H
  #define TASK_H
  
  #include &lt;QDateTime&gt;
  #include &lt;QTime&gt;
  
  class Task
  {
  private:
      bool ifDone;
      QString name;
      QString description;
      QDateTime *startTime;
      QTime *start;
      QDateTime *endTime;
      QTime *end;
      bool neededReminder;
      QDateTime *reminderTime;
  
  public:
      Task(QString _name, QString _description, QDate *dayClicked, 
           QTime *_startTime, QTime *_endTime, bool reminder);
  
      QString toString();
  };
  
  #endif // TASK_H    `
  </code></pre>
  
  <p>task.cpp</p>
  
  <pre><code>#include "task.h"
  
  Task::Task(QString _name, QString _description, QDate *dayClicked, 
      QTime *_startTime, QTime *_endTime, bool reminder)
  {
      ifDone = 0;
      name = _name;
      description = _description;
      start = _startTime;
      end = _endTime;
      startTime = new QDateTime(*dayClicked, *start);
      endTime = new QDateTime(*dayClicked, *end);
      neededReminder = reminder;
  }
  
  QString Task::toString() {
      QString task;
      task.append(this-&gt;name);
      task.append(" ");
      task.append(this-&gt;start-&gt;toString("HH:mm"));
      task.append(" - ");
      task.append(this-&gt;end-&gt;toString("HH:mm"));
      return task;
  }
  </code></pre>
  
  <p>I was trying to #include this class to testing class as well as adding both .h and .cpp files to the project and I didn't manage to do anything. Can anyone write some sample testing methods (for toString method and constructor) for the above class so I could carry on myself with the rest. Thanks in advance.</p>