void Admintest::test_opDispatched_unconnected() { m_account->m_connection = 0; Link_sent_called = false; ASSERT_TRUE(!m_account->m_monitorConnection.connected()); Operation op; m_account->opDispatched(op); // The operation should not have been sent here ASSERT_TRUE(!Link_sent_called); }
void Admintest::test_opDispatched() { Link_sent_called = false; m_account->m_monitorConnection = null_signal.connect(sigc::mem_fun(this, &Admintest::null_method)); ASSERT_TRUE(m_account->m_monitorConnection.connected()); Operation op; m_account->opDispatched(op); // The account is connected, so calling this should not affect the signal ASSERT_TRUE(m_account->m_monitorConnection.connected()); // The operation should have been sent here ASSERT_TRUE(Link_sent_called); }
void Admintest::test_opDispatched_unconnected_monitored() { m_account->m_connection = 0; Link_sent_called = false; m_account->m_monitorConnection = null_signal.connect(sigc::mem_fun(this, &Admintest::null_method)); ASSERT_TRUE(m_account->m_monitorConnection.connected()); Operation op; m_account->opDispatched(op); // The account is unconnected, so calling opDispatched should not // cause the signal to get cut off ASSERT_TRUE(!m_account->m_monitorConnection.connected()); // The operation should not have been sent here ASSERT_TRUE(!Link_sent_called); }