136
136
TEST_F(ActionsFixture, Activate)
138
std::vector<MockTransfer::Action> expected_history;
139
EXPECT_EQ(expected_history, m_transfer_a->history());
141
m_live_actions->activate(m_transfer_a->id());
142
expected_history.push_back(MockTransfer::Pause);
143
EXPECT_EQ(expected_history, m_transfer_a->history());
145
m_live_actions->activate(m_transfer_a->id());
146
expected_history.push_back(MockTransfer::Resume);
147
EXPECT_EQ(expected_history, m_transfer_a->history());
149
m_transfer_a->state().set(Transfer::DONE);
150
m_live_actions->activate(m_transfer_a->id());
151
expected_history.push_back(MockTransfer::Open);
152
EXPECT_EQ(expected_history, m_transfer_a->history());
154
m_transfer_a->state().set(Transfer::CANCELING);
155
m_live_actions->activate(m_transfer_a->id());
156
expected_history.push_back(MockTransfer::Clear);
157
EXPECT_EQ(expected_history, m_transfer_a->history());
160
TEST_F(ActionsFixture, InvalidId)
162
EXPECT_EQ(empty_history, m_transfer_a->history());
163
EXPECT_EQ(empty_history, m_transfer_b->history());
165
m_live_actions->pause("unknown-id");
166
increment_expected_errors(G_LOG_LEVEL_CRITICAL);
167
EXPECT_EQ(empty_history, m_transfer_a->history());
168
EXPECT_EQ(empty_history, m_transfer_b->history());
170
m_live_actions->resume("unknown-id");
171
increment_expected_errors(G_LOG_LEVEL_CRITICAL);
172
EXPECT_EQ(empty_history, m_transfer_a->history());
173
EXPECT_EQ(empty_history, m_transfer_b->history());
175
m_live_actions->cancel("unknown-id");
176
increment_expected_errors(G_LOG_LEVEL_CRITICAL);
177
EXPECT_EQ(empty_history, m_transfer_a->history());
178
EXPECT_EQ(empty_history, m_transfer_b->history());
180
m_live_actions->resume("unknown-id");
181
increment_expected_errors(G_LOG_LEVEL_CRITICAL);
182
EXPECT_EQ(empty_history, m_transfer_a->history());
183
EXPECT_EQ(empty_history, m_transfer_b->history());