summaryrefslogtreecommitdiff
path: root/tests/unit/Card/Card_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/Card/Card_test.cpp')
-rw-r--r--tests/unit/Card/Card_test.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/unit/Card/Card_test.cpp b/tests/unit/Card/Card_test.cpp
new file mode 100644
index 0000000..bfae243
--- /dev/null
+++ b/tests/unit/Card/Card_test.cpp
@@ -0,0 +1,36 @@
+#include <gtest/gtest.h>
+#include <QtCore>
+
+#include "Card_test.h"
+#include "../../common/printQtTypes.h"
+#include "../../../src/dictionary/Card.h"
+#include "../../../src/dictionary/ICardPack.h"
+#include "../../mocks/CardPack_mock.h"
+
+void CardTest::SetUp()
+ {
+ defaultPack = new CardPackMock;
+ }
+
+void CardTest::TearDown()
+ {
+ delete defaultPack;
+ }
+
+TEST_F(CardTest, Create)
+ {
+ Card card(defaultPack);
+
+ ASSERT_EQ(defaultPack, card.getCardPack());
+ ASSERT_TRUE(card.getQuestion().isEmpty());
+ ASSERT_TRUE(card.getAnswers().isEmpty());
+ }
+
+TEST_F(CardTest, Create_NullPack)
+ {
+ Card card(NULL);
+
+ ASSERT_EQ(NULL, card.getCardPack());
+ ASSERT_TRUE(card.getQuestion().isEmpty());
+ ASSERT_TRUE(card.getAnswers().isEmpty());
+ }