blob: bfae2433f04160d1ccb1e198dade2db527afe583 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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());
}
|