From: Cheoleun Moon Date: Thu, 3 Sep 2020 02:26:40 +0000 (+0900) Subject: [Connection][TCSACR-360][AddRoute and RemoveRoute throw UnauthorizedAccessException] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1b0596c8714d560147cbc71394fd4de63cbe259;p=test%2Ftct%2Fcsharp%2Fapi.git [Connection][TCSACR-360][AddRoute and RemoveRoute throw UnauthorizedAccessException] Change-Id: Ic0837c39f6b36a4f2797de4b363de718710bf10b Signed-off-by: Cheoleun Moon --- diff --git a/tct-suite-vs/Tizen.Connection.Tests/testcase/TSConnectionManager.cs b/tct-suite-vs/Tizen.Connection.Tests/testcase/TSConnectionManager.cs index 6244599ce..cac87652e 100755 --- a/tct-suite-vs/Tizen.Connection.Tests/testcase/TSConnectionManager.cs +++ b/tct-suite-vs/Tizen.Connection.Tests/testcase/TSConnectionManager.cs @@ -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"); }