[Connection][Non-ACR][Change compared value for checking ResetStatistics()] 28/218828/1
authorSeonah Moon <seonah1.moon@samsung.com>
Thu, 28 Nov 2019 11:02:01 +0000 (20:02 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 28 Nov 2019 11:02:04 +0000 (20:02 +0900)
In case of TV, wifi interface isn't down although DeactivateAsync is
success. It is normal operation on TV, but if wifi interface isn't down,
statistic information would be updated.
So, this change modifed compared value for these exception case.

Change-Id: Ib7a416d90bcf7dcb6592f9ddc7c87bee400cb823

tct-suite-vs/Tizen.Connection.Tests/testcase/TSConnectionManager.cs

index 6244599..d5b8944 100755 (executable)
@@ -664,18 +664,25 @@ namespace Tizen.Network.Connection.Tests
                 Log.Info(Globals.LogTag, "ResetStatistics_ALL_CONNECTION_TYPE start");
                 await tearDown();
 
+                var data = ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.LastReceivedData);
                 ConnectionManager.ResetStatistics(ConnectionType.WiFi, StatisticsType.LastReceivedData);
                 Log.Info(Globals.LogTag, "Reset LastReceivedData");
-                Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.LastReceivedData), "Reset LastReceivedData failed");
+                Assert.IsTrue(data > ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.LastReceivedData), "Reset LastReceivedData failed");
+
+                data = ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.LastSentData);
                 ConnectionManager.ResetStatistics(ConnectionType.WiFi, StatisticsType.LastSentData);
                 Log.Info(Globals.LogTag, "Reset LastSentData");
-                Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.LastSentData), "Reset LastSentData failed");
+                Assert.IsTrue(data > ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.LastSentData), "Reset LastSentData failed");
+
+                data = ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalReceivedData);
                 ConnectionManager.ResetStatistics(ConnectionType.WiFi, StatisticsType.TotalReceivedData);
                 Log.Info(Globals.LogTag, "Reset TotalReceivedData");
-                Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalReceivedData), "Reset TotalReceivedData failed");
+                Assert.IsTrue(data > ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalReceivedData), "Reset TotalReceivedData failed");
+
+                data = ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalSentData);
                 ConnectionManager.ResetStatistics(ConnectionType.WiFi, StatisticsType.TotalSentData);
                 Log.Info(Globals.LogTag, "Reset TotalSentData");
-                Assert.IsTrue(0 == ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalSentData), "Reset TotalSentData failed");
+                Assert.IsTrue(data > ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalSentData), "Reset TotalSentData failed");
 
                 // POSTCONDITION
                 await setUp();