summaryrefslogtreecommitdiff
path: root/tests/unit/Card/Card_test.cpp
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
commitd24f813f3f2a05c112e803e4256b53535895fc98 (patch)
tree601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /tests/unit/Card/Card_test.cpp
Initial mirror commitHEADmaster
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());
+ }