[Network][Non-ACR] Fix trivial mistakes 07/178607/1
authorchleun.moon <chleun.moon@samsung.com>
Thu, 10 May 2018 23:50:35 +0000 (08:50 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Thu, 10 May 2018 23:50:40 +0000 (08:50 +0900)
The first parameter of Assert.AreEqual is intended as the expected
value, and the second as the actual value.

Change-Id: I75f6a8b9a28ec51afa1c5a5c915adefb5f632640

tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionItem.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionManager.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionProfileManager.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiNetwork.cs

index 393ae8e..27fdd64 100755 (executable)
@@ -66,7 +66,7 @@ namespace Tizen.Network.Connection.Tests
                  * TEST CODE
                  */
 
-                Assert.AreEqual(ConnectionManager.CurrentConnection.Type, ConnectionType.WiFi, "ConnectionItem_Type_GET is fail");
+                Assert.AreEqual(ConnectionType.WiFi, ConnectionManager.CurrentConnection.Type, "ConnectionItem_Type_GET is fail");
 
             }
             catch (NotSupportedException)
@@ -97,7 +97,7 @@ namespace Tizen.Network.Connection.Tests
                 /**
                  * PRE CONDITION
                  */
-                Log.Info(Globals.LogTag, "EthernetCableState_GET start");
+                Log.Info(Globals.LogTag, "ConnectionItem_State_GET start");
 
                 await setUp();
                 await Task.Delay(5000);
@@ -105,7 +105,7 @@ namespace Tizen.Network.Connection.Tests
                 /**
                  * TEST CODE
                  */
-                Assert.AreEqual(ConnectionManager.CurrentConnection.State.ToString(), ConnectionState.Connected.ToString(), "CurrentConnction_STATE is fail");
+                Assert.AreEqual(ConnectionState.Connected.ToString(), ConnectionManager.CurrentConnection.State.ToString(), "CurrentConnction_STATE is fail");
 
                 /**
                  * POST CONDITION
index 21f6451..21cf3a8 100755 (executable)
@@ -717,8 +717,8 @@ namespace Tizen.Network.Connection.Tests
                  * */
                 ConnectionManager.ConnectionTypeChanged += EventHandlerConnectionTypeChanged;
                 await tearDown();
-                Assert.IsTrue(_flag, "Event ChangeType is fail");
                 ConnectionManager.ConnectionTypeChanged -= EventHandlerConnectionTypeChanged;
+                Assert.IsTrue(_flag, "Event ChangeType is fail");
                 // POSTCONDITION
                 await setUp();
             }
@@ -768,8 +768,8 @@ namespace Tizen.Network.Connection.Tests
                 await _wifiAP.DisconnectAsync();
                 await Task.Delay(5000);
                 await setUp();
-                Assert.IsTrue(_flag, "Event ChangeType is fail");
                 ConnectionManager.IPAddressChanged -= EventHandlerIpAddressChanged;
+                Assert.IsTrue(_flag, "Event ChangeType is fail");
             }
             catch (NotSupportedException)
             {
@@ -876,8 +876,8 @@ namespace Tizen.Network.Connection.Tests
                  * */
                 Log.Info(Globals.LogTag, "ConnectionState=" + ConnectionManager.CurrentConnection.State.ToString());
                 Log.Info(Globals.LogTag, "ConnectionType=" + ConnectionManager.CurrentConnection.Type.ToString());
-                Assert.AreEqual(ConnectionManager.CurrentConnection.State.ToString(), ConnectionState.Connected.ToString(), "CurrentConnection_STATE is fail");
-                Assert.AreEqual(ConnectionManager.CurrentConnection.Type.ToString(), ConnectionType.WiFi.ToString(), "CurrentConnection_STATE is fail");
+                Assert.AreEqual(ConnectionState.Connected.ToString(), ConnectionManager.CurrentConnection.State.ToString(), "CurrentConnection_STATE is fail");
+                Assert.AreEqual(ConnectionType.WiFi.ToString(), ConnectionManager.CurrentConnection.Type.ToString(), "CurrentConnection_STATE is fail");
                 // POSTCONDITION
                 await setUp();
             }
index 1e115e8..b77bf4d 100644 (file)
@@ -57,7 +57,7 @@ namespace Tizen.Network.Tests
         public static async Task setUp()
         {
             await networkSetup.WiFiActivate(networkParameter.wnPRIVATE, networkParameter.wType.wPrivate, networkParameter.wPASS);
-            await Task.Delay(5000);
+            await Task.Delay(3000);
         }
 
         public static async Task tearDown()
@@ -311,11 +311,10 @@ namespace Tizen.Network.Tests
                 _numTask = 0;
                 foreach (var p in _list)
                 {
-                    Console.WriteLine("HYUKIN Profile:" + p.Name);
                     if (p.Type == ConnectionProfileType.WiFi)
                         _numTask++;
                 }
-                Assert.AreEqual(_numTask, 1);
+                Assert.AreEqual(1, _numTask);
             }
             catch (NotSupportedException)
             {
@@ -358,12 +357,10 @@ namespace Tizen.Network.Tests
                 _numTask = 0;
                 foreach (var p in _list)
                 {
-                    //Console.WriteLine("HYUKIN Profile:" + p.Name);
                     if (p.Type == ConnectionProfileType.WiFi)
                         _numTask++;
                 }
-                //Console.WriteLine("HYUKIN Profile:" + _numTask);
-                Assert.AreEqual(_numTask, 0);
+                Assert.AreEqual(0, _numTask);
                 // POSTCONDITION
                 if (isWiFiSupported && !WiFiManager.IsActive)
                     await setUp();
@@ -422,7 +419,7 @@ namespace Tizen.Network.Tests
                      */
                     _currCP = ConnectionProfileManager.GetCurrentProfile();
                     Assert.IsNotNull(_currCP);
-                    Assert.AreEqual(_currCP.Name.ToString(), _wifiAP.NetworkInformation.Essid.ToString(), "WiFi manager should get right current profile");
+                    Assert.AreEqual(_wifiAP.NetworkInformation.Essid.ToString(), _currCP.Name.ToString(), "WiFi manager should get right current profile");
                 }
             }
             catch (NotSupportedException)
index dcf4260..c74e7f0 100755 (executable)
@@ -36,7 +36,7 @@ namespace Tizen.Network.WiFi.Tests
         public static async Task SetUp()
         {
             await networkSetup.WiFiActivate(networkParameter.wnPRIVATE, networkParameter.wType.wPrivate, networkParameter.wPASS);
-            await Task.Delay(5000);
+            await Task.Delay(3000);
         }
 
         [Test]
@@ -66,7 +66,7 @@ namespace Tizen.Network.WiFi.Tests
                 Assert.IsNotNull(_wifiAP, "No WiFi connection");
                 _wiFiNetwork = _wifiAP.NetworkInformation;
                 var essid = _wiFiNetwork.Essid;
-                Assert.AreEqual(essid, networkParameter.wnPRIVATE, "Essid doesn't get successful");
+                Assert.AreEqual(networkParameter.wnPRIVATE, essid, "Essid doesn't get successful");
 
                 Log.Info(Globals.LogTag, "Successfully done");
             }
@@ -169,7 +169,7 @@ namespace Tizen.Network.WiFi.Tests
                 _wifiAP = WiFiManager.GetConnectedAP();
                 Assert.IsNotNull(_wifiAP, "No WiFi connection");
                 _wiFiNetwork = _wifiAP.NetworkInformation;
-                Assert.AreEqual((int)(_wiFiNetwork.ConnectionState), (int)(WiFiConnectionState.Connected), "ConnectionState doesn't get successful");
+                Assert.AreEqual((int)(WiFiConnectionState.Connected), (int)(_wiFiNetwork.ConnectionState), "ConnectionState doesn't get successful");
 
                 Log.Info(Globals.LogTag, "Successfully done");
             }
@@ -537,7 +537,7 @@ namespace Tizen.Network.WiFi.Tests
                 _wiFiNetwork.ProxyAddress = proxyAddress;
                 _wifiAP.Update();
 
-                Assert.AreEqual(_wiFiNetwork.ProxyAddress, proxyAddress, "ProxyAddress doesn't set and get successful");
+                Assert.AreEqual(proxyAddress, _wiFiNetwork.ProxyAddress, "ProxyAddress doesn't set and get successful");
 
                 Log.Info(Globals.LogTag, "Successfully done");
             }
@@ -591,7 +591,7 @@ namespace Tizen.Network.WiFi.Tests
                 _wiFiNetwork.ProxyType = WiFiProxyType.Manual;
                 _wifiAP.Update();
 
-                Assert.AreEqual((int)(_wiFiNetwork.ProxyType), (int)(WiFiProxyType.Manual), "ProxyType doesn't set and get successful");
+                Assert.AreEqual((int)WiFiProxyType.Manual, (int)(_wiFiNetwork.ProxyType), "ProxyType doesn't set and get successful");
 
                 Log.Info(Globals.LogTag, "Successfully done");
             }