-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestOcrAccountStreamReader.cpp
53 lines (44 loc) · 1.1 KB
/
TestOcrAccountStreamReader.cpp
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <gmock/gmock.h>
#include "OcrAccountStreamReader.h"
using namespace testing;
using std::stringstream;
using std::vector;
using std::string;
namespace
{
vector<string> accountList =
{
"123456789",
};
string fileContents =
" _ _ _ _ _ _ _ \n"
" | _| _||_||_ |_ ||_||_|\n"
" ||_ _| | _||_| ||_| _|\n"
"\n"
;
vector<string> accountVector =
{
" _ _ _ _ _ _ _ ",
" | _| _||_||_ |_ ||_||_|",
" ||_ _| | _||_| ||_| _|"
};
vector<OcrAccount> ocrAccountList =
{
OcrAccount(accountVector),
};
}
class TestOcrAccountStreamReader: public Test
{
};
TEST_F(TestOcrAccountStreamReader, CanReadStreamAsStringVector)
{
stringstream stream(fileContents);
OcrAccountStreamReader reader(stream);
EXPECT_EQ(accountList, vector<string>(reader));
}
TEST_F(TestOcrAccountStreamReader, CanReadStreamAsAccountVector)
{
stringstream stream(fileContents);
OcrAccountStreamReader reader(stream);
EXPECT_EQ(ocrAccountList, vector<OcrAccount>(reader));
}