@@ -19,8 +19,8 @@ using namespace tao::graphqlpeg;
19
19
20
20
class TodayServiceCase : public ::testing::Test
21
21
{
22
- protected :
23
- void SetUp () override
22
+ public :
23
+ static void SetUpTestCase ()
24
24
{
25
25
std::string fakeAppointmentId (" fakeAppointmentId" );
26
26
_fakeAppointmentId.resize (fakeAppointmentId.size ());
@@ -35,15 +35,15 @@ class TodayServiceCase : public ::testing::Test
35
35
std::copy (fakeFolderId.cbegin (), fakeFolderId.cend (), _fakeFolderId.begin ());
36
36
37
37
auto query = std::make_shared<today::Query>(
38
- [this ]() -> std::vector<std::shared_ptr<today::Appointment>>
38
+ []() -> std::vector<std::shared_ptr<today::Appointment>>
39
39
{
40
40
++_getAppointmentsCount;
41
41
return { std::make_shared<today::Appointment>(std::vector<unsigned char >(_fakeAppointmentId), " tomorrow" , " Lunch?" , false ) };
42
- }, [this ]() -> std::vector<std::shared_ptr<today::Task>>
42
+ }, []() -> std::vector<std::shared_ptr<today::Task>>
43
43
{
44
44
++_getTasksCount;
45
45
return { std::make_shared<today::Task>(std::vector<unsigned char >(_fakeTaskId), " Don't forget" , true ) };
46
- }, [this ]() -> std::vector<std::shared_ptr<today::Folder>>
46
+ }, []() -> std::vector<std::shared_ptr<today::Folder>>
47
47
{
48
48
++_getUnreadCountsCount;
49
49
return { std::make_shared<today::Folder>(std::vector<unsigned char >(_fakeFolderId), " \" Fake\" Inbox" , 3 ) };
@@ -61,16 +61,34 @@ class TodayServiceCase : public ::testing::Test
61
61
_service = std::make_shared<today::Operations>(query, mutation, subscription);
62
62
}
63
63
64
- std::vector<unsigned char > _fakeAppointmentId;
65
- std::vector<unsigned char > _fakeTaskId;
66
- std::vector<unsigned char > _fakeFolderId;
64
+ static void TearDownTestCase ()
65
+ {
66
+ _fakeAppointmentId.clear ();
67
+ _fakeTaskId.clear ();
68
+ _fakeFolderId.clear ();
69
+ _service.reset ();
70
+ }
67
71
68
- std::shared_ptr<today::Operations> _service;
69
- size_t _getAppointmentsCount = 0 ;
70
- size_t _getTasksCount = 0 ;
71
- size_t _getUnreadCountsCount = 0 ;
72
+ protected:
73
+ static std::vector<unsigned char > _fakeAppointmentId;
74
+ static std::vector<unsigned char > _fakeTaskId;
75
+ static std::vector<unsigned char > _fakeFolderId;
76
+
77
+ static std::shared_ptr<today::Operations> _service;
78
+ static size_t _getAppointmentsCount;
79
+ static size_t _getTasksCount;
80
+ static size_t _getUnreadCountsCount;
72
81
};
73
82
83
+ std::vector<unsigned char > TodayServiceCase::_fakeAppointmentId;
84
+ std::vector<unsigned char > TodayServiceCase::_fakeTaskId;
85
+ std::vector<unsigned char > TodayServiceCase::_fakeFolderId;
86
+
87
+ std::shared_ptr<today::Operations> TodayServiceCase::_service;
88
+ size_t TodayServiceCase::_getAppointmentsCount = 0 ;
89
+ size_t TodayServiceCase::_getTasksCount = 0 ;
90
+ size_t TodayServiceCase::_getUnreadCountsCount = 0 ;
91
+
74
92
TEST_F (TodayServiceCase, QueryEverything)
75
93
{
76
94
auto ast = peg::parseString (R"gql(
0 commit comments