Mercurial > irccd
comparison tests/cmd-rule-edit/main.cpp @ 488:7e273b7f4f92
Irccd: new coding style, closes #576
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 26 Sep 2017 17:18:47 +0200 |
parents | acb2d4990249 |
children | c729f06c6f27 |
comparison
equal
deleted
inserted
replaced
487:beb6c638b841 | 488:7e273b7f4f92 |
---|---|
19 #include <command.hpp> | 19 #include <command.hpp> |
20 #include <command-tester.hpp> | 20 #include <command-tester.hpp> |
21 #include <service.hpp> | 21 #include <service.hpp> |
22 | 22 |
23 using namespace irccd; | 23 using namespace irccd; |
24 using namespace irccd::command; | |
25 | 24 |
26 class RuleEditCommandTest : public CommandTester { | 25 class RuleEditCommandTest : public CommandTester { |
27 protected: | 26 protected: |
28 nlohmann::json m_result; | 27 nlohmann::json m_result; |
29 | 28 |
40 return false; | 39 return false; |
41 } | 40 } |
42 | 41 |
43 public: | 42 public: |
44 RuleEditCommandTest() | 43 RuleEditCommandTest() |
45 : CommandTester(std::make_unique<RuleEditCommand>()) | 44 : CommandTester(std::make_unique<rule_edit_command>()) |
46 { | 45 { |
47 m_irccd.commands().add(std::make_unique<RuleInfoCommand>()); | 46 m_irccd.commands().add(std::make_unique<rule_info_command>()); |
48 m_irccd.rules().add(Rule( | 47 m_irccd.rules().add(rule( |
49 { "s1", "s2" }, | 48 { "s1", "s2" }, |
50 { "c1", "c2" }, | 49 { "c1", "c2" }, |
51 { "o1", "o2" }, | 50 { "o1", "o2" }, |
52 { "p1", "p2" }, | 51 { "p1", "p2" }, |
53 { "onMessage", "onCommand" }, | 52 { "onMessage", "onCommand" }, |
54 RuleAction::Drop | 53 rule::action_type::drop |
55 )); | 54 )); |
56 m_irccdctl.client().onMessage.connect([&] (auto result) { | 55 m_irccdctl.client().onMessage.connect([&] (auto result) { |
57 m_result = result; | 56 m_result = result; |
58 }); | 57 }); |
59 } | 58 } |