[Connection][TCSACR-360][AddRoute and RemoveRoute throw UnauthorizedAccessException] 67/243067/3
authorCheoleun Moon <chleun.moon@samsung.com>
Thu, 3 Sep 2020 02:26:40 +0000 (11:26 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Fri, 4 Sep 2020 05:33:46 +0000 (14:33 +0900)
Change-Id: Ic0837c39f6b36a4f2797de4b363de718710bf10b
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
tct-suite-vs/Tizen.Connection.Tests/testcase/TSConnectionManager.cs

index 6244599ce5dd5a3185a483740bde66a7c2ce077b..cac87652e5f7a8dbbc7048889d7851240b871b6a 100755 (executable)
@@ -934,12 +934,12 @@ namespace Tizen.Network.Connection.Tests
 
         [Test]
         [Category("P1")]
-        [Description("Test AddRoute Method")]
+        [Description("Test AddRoute Method throws UnauthorizedAccessException")]
         [Property("SPEC", "Tizen.Network.Connection.ConnectionManager.AddRoute M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
         [Property("AUTHOR", "Cheoleun Moon, chleun.moon@samsung.com")]
-        public async Task AddRoute_WiFi()
+        public async Task AddRoute_WiFi_UNAUTHORIZED_ACCESS_EXCEPTION()
         {
             try
             {
@@ -949,7 +949,7 @@ namespace Tizen.Network.Connection.Tests
                 var hostAddress = IPAddress.Parse("1.1.1.1");
                 var gateway = IPAddress.Parse("192.168.0.1");
                 ConnectionManager.AddRoute(AddressFamily.IPv4, "wlan0", hostAddress, gateway);
-                Assert.True(true, "AddRoute");
+                Assert.IsTrue(false, "AddRoute");
             }
             catch (NotSupportedException)
             {
@@ -959,6 +959,10 @@ namespace Tizen.Network.Connection.Tests
             {
                 Assert.IsTrue(isWiFiSupported == false && e.InnerException.GetType() == typeof(NotSupportedException), "Invalid NotSupportedException or TypeInitializationException");
             }
+            catch (UnauthorizedAccessException)
+            {
+                Assert.IsTrue(true, "AddRoute");
+            }
             catch (Exception ex)
             {
                 Assert.IsTrue(false, "Exception occurs. Msg : " + ex.ToString());
@@ -1002,12 +1006,12 @@ namespace Tizen.Network.Connection.Tests
 
         [Test]
         [Category("P1")]
-        [Description("Test RemoveRoute Method")]
+        [Description("Test RemoveRoute Method throws UnauthorizedAccessException")]
         [Property("SPEC", "Tizen.Network.Connection.ConnectionManager.RemoveRoute M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MR")]
         [Property("AUTHOR", "Cheoleun Moon, chleun.moon@samsung.com")]
-        public async Task RemoveRoute_WiFi()
+        public async Task RemoveRoute_WiFi_UNAUTHORIZED_ACCESS_EXCEPTION()
         {
             try
             {
@@ -1018,7 +1022,7 @@ namespace Tizen.Network.Connection.Tests
                 var gateway = IPAddress.Parse("192.168.0.1");
                 ConnectionManager.AddRoute(AddressFamily.IPv4, "wlan0", hostAddress, gateway);
                 ConnectionManager.RemoveRoute(AddressFamily.IPv4, "wlan0", hostAddress, gateway);
-                Assert.True(true, "RemoveRoute");
+                Assert.IsTrue(false, "RemoveRoute");
             }
             catch (NotSupportedException)
             {
@@ -1028,6 +1032,10 @@ namespace Tizen.Network.Connection.Tests
             {
                 Assert.IsTrue(isWiFiSupported == false && e.InnerException.GetType() == typeof(NotSupportedException), "Invalid NotSupportedException or TypeInitializationException");
             }
+            catch (UnauthorizedAccessException)
+            {
+                Assert.IsTrue(true, "RemoveRoute");
+            }
             catch (Exception ex)
             {
                 Assert.IsTrue(false, "Exception occurs. Msg : " + ex.ToString());
@@ -1050,7 +1058,6 @@ namespace Tizen.Network.Connection.Tests
                 await setUp();
                 var hostAddress = IPAddress.Parse("1.1.1.1");
                 var gateway = IPAddress.Parse("192.168.0.1");
-                ConnectionManager.AddRoute(AddressFamily.IPv4, "wlan0", hostAddress, gateway);
                 ConnectionManager.RemoveRoute(AddressFamily.IPv4, "wlan0", null, null);
                 Assert.True(false, "Should throw ArgumentNullException");
             }