diff --git a/Tests/unit_test/test_NetworkManagerConnectivity.cpp b/Tests/unit_test/test_NetworkManagerConnectivity.cpp index a045202..d9995c5 100644 --- a/Tests/unit_test/test_NetworkManagerConnectivity.cpp +++ b/Tests/unit_test/test_NetworkManagerConnectivity.cpp @@ -11,76 +11,15 @@ class ConnectivityMonitorTest : public ::testing::Test { WPEFramework::Plugin::ConnectivityMonitor cm; }; -TEST_F(ConnectivityMonitorTest, StartContinuousMonitor_Success) { - int timeout = 30; - bool result = cm.startContinuousConnectivityMonitor(timeout); - EXPECT_TRUE(result); -} - -TEST_F(ConnectivityMonitorTest, StartContinuousMonitor_FailureNegativeTimeout) { - int timeout = -1; - bool result = cm.startContinuousConnectivityMonitor(timeout); - EXPECT_TRUE(result); -} - -TEST_F(ConnectivityMonitorTest, StartMonitorWithTimeoutLessThanMinimum) { - int timeout = 3; - bool result = cm.startContinuousConnectivityMonitor(timeout); - EXPECT_TRUE(result); -} - -TEST_F(ConnectivityMonitorTest, MonitorFailsToStart) { - int timeout = 0; - bool result = cm.startContinuousConnectivityMonitor(timeout); - EXPECT_TRUE(result); -} - -TEST_F(ConnectivityMonitorTest, StopContinuousMonitor_WhenStarted) { - int timeout = 30; - cm.startContinuousConnectivityMonitor(timeout); - bool result = cm.stopContinuousConnectivityMonitor(); - EXPECT_TRUE(result); -} - -TEST_F(ConnectivityMonitorTest, StopContinuousMonitor_WhenNotStarted) { - bool result = cm.stopContinuousConnectivityMonitor(); - EXPECT_TRUE(result); -} - -TEST_F(ConnectivityMonitorTest, StopContinuousMonitor_AfterMultipleStartsAndStops) { - int timeout = 30; - cm.startContinuousConnectivityMonitor(timeout); - bool result = cm.stopContinuousConnectivityMonitor(); - EXPECT_TRUE(result); - - cm.startContinuousConnectivityMonitor(timeout); - result = cm.stopContinuousConnectivityMonitor(); - EXPECT_TRUE(result); - - cm.startContinuousConnectivityMonitor(timeout); - result = cm.stopContinuousConnectivityMonitor(); - EXPECT_TRUE(result); -} - -TEST_F(ConnectivityMonitorTest, StopContinuousMonitor_LongRunningMonitor) { - int timeout = 1000; - cm.startContinuousConnectivityMonitor(timeout); - std::this_thread::sleep_for(std::chrono::seconds(2)); - - bool result = cm.stopContinuousConnectivityMonitor(); +TEST_F(ConnectivityMonitorTest, StartConnectivityMonitor_Success) { + bool result = cm.startConnectivityMonitor(); EXPECT_TRUE(result); -} - -TEST_F(ConnectivityMonitorTest, StartMonitor_WithInterfaceStatus) { bool result = cm.startConnectivityMonitor(); EXPECT_TRUE(result); } -TEST_F(ConnectivityMonitorTest, StartMonitor_NotifyIfAlreadyMonitoring) { - bool result = false; - result = cm.startConnectivityMonitor(); - EXPECT_TRUE(result); - result = cm.startConnectivityMonitor(); +TEST_F(ConnectivityMonitorTest, StartConnectivityMonitor_Success) { + bool result = cm.stopConnectivityMonitor(); EXPECT_TRUE(result); }