11#include < gtest/gtest.h>
22#include < memory>
3+ #include " events_cmd_exec.hh"
34
45#include " events_cmd.hh"
5- #include " docker_client.hh"
66
7- using namespace dockercpp ::command;
7+ namespace dockercpp ::command::exec::test {
88
99class EventsCmdTest : public ::testing::Test {
1010protected:
@@ -17,35 +17,44 @@ class EventsCmdTest : public ::testing::Test {
1717 }
1818};
1919
20- // TEST_F(EventsCmdTest, TestEventsCmdWithSince) {
21- // std::unique_ptr<events::Exec> exec = std::make_unique<events::Exec>();
22- // EventsCmdImpl cmd(std::move(exec));
20+ TEST_F (EventsCmdTest, TestEventsCmdWithSince) {
21+ auto eventsExec = std::make_unique<command::exec::EventsCmdExec>();
2322
24- // int64_t testSince = 1234567890;
25- // cmd.withSince(testSince);
23+ auto cmd = std::make_shared<command::EventsCmdImpl>(std::move (eventsExec));
24+
25+ int64_t testSince = 1234567890 ;
26+ cmd->withSince (testSince);
2627
27- // EXPECT_EQ(cmd. getSince(), testSince);
28- // }
28+ EXPECT_EQ (cmd-> getSince (), testSince);
29+ }
2930
30- // TEST_F(EventsCmdTest, TestEventsCmdWithUntil) {
31- // std::unique_ptr<events::Exec> exec = std::make_unique<events::Exec>();
32- // EventsCmdImpl cmd(std::move(exec));
31+ TEST_F (EventsCmdTest, TestEventsCmdWithUntil) {
32+ auto eventsExec = std::make_unique<command::exec::EventsCmdExec>();
3333
34- // int64_t testUntil = 1234567890;
35- // cmd.withUntil(testUntil);
34+ auto cmd = std::make_shared<command::EventsCmdImpl>(std::move (eventsExec));
35+
36+
37+ int64_t testUntil = 1234567890 ;
38+ cmd->withUntil (testUntil);
3639
37- // EXPECT_EQ(cmd. getUntil(), testUntil);
38- // }
40+ EXPECT_EQ (cmd-> getUntil (), testUntil);
41+ }
3942
40- // TEST_F(EventsCmdTest, TestEventsCmdChaining) {
41- // std::unique_ptr<events::Exec> exec = std::make_unique<events::Exec>();
42- // EventsCmdImpl cmd(std::move(exec));
43+ TEST_F (EventsCmdTest, TestEventsCmdChaining) {
44+ auto eventsExec = std::make_unique<command::exec::EventsCmdExec>();
4345
44- // int64_t testSince = 1234567890;
45- // int64_t testUntil = 2234567890;
46+ auto cmd = std::make_shared<command::EventsCmdImpl>(std::move (eventsExec));
47+
48+
49+ int64_t testSince = 1234567890 ;
50+ int64_t testUntil = 2234567890 ;
4651
47- // cmd.withSince(testSince).withUntil(testUntil);
52+ cmd->withSince (testSince).withUntil (testUntil);
53+
54+ EXPECT_EQ (cmd->getSince (), testSince);
55+ EXPECT_EQ (cmd->getUntil (), testUntil);
56+ }
57+
58+
59+ }
4860
49- // EXPECT_EQ(cmd.getSince(), testSince);
50- // EXPECT_EQ(cmd.getUntil(), testUntil);
51- // }
0 commit comments