Example #1
0
void test_ResultList::test_rowCount() {
  ResultList list;
  QCOMPARE(list.rowCount(), 0);

  list.appendResult(Definition{});
  QCOMPARE(list.rowCount(), 1);

  list.appendResult(Definition{});
  QCOMPARE(list.rowCount(), 2);

  list.setWord("test");
  QCOMPARE(list.rowCount(), 0);
}
Example #2
0
void test_ResultList::test_appendResult() {
  ResultList list;
  QCOMPARE(list.rowCount(), 0);

  list.appendResult(Definition{"word", "text"});
  QCOMPARE(list.rowCount(), 0);

  list.setWord("word");

  list.appendResult(Definition{"word", "text"});
  QCOMPARE(list.rowCount(), 1);

  list.appendResult(Definition{"WORD", "text"});
  QCOMPARE(list.rowCount(), 2);
}