diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
commit | d24f813f3f2a05c112e803e4256b53535895fc98 (patch) | |
tree | 601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /tests/unit/Card/Card_test.cpp |
Diffstat (limited to 'tests/unit/Card/Card_test.cpp')
-rw-r--r-- | tests/unit/Card/Card_test.cpp | 36 |
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()); + } |