[Nsd][Non-ACR][Add catch clauses for ArgumentExeption and NotSupportedException] 48/211548/5
authorCheoleun Moon <chleun.moon@samsung.com>
Tue, 6 Aug 2019 09:44:48 +0000 (18:44 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Thu, 8 Aug 2019 03:55:12 +0000 (12:55 +0900)
Change-Id: I967829306fdb2fc8116b0ab71a3917c65bb25b78
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
tct-suite-vs/Tizen.Nsd.Tests/testcase/TSDnssdBrowser.cs
tct-suite-vs/Tizen.Nsd.Tests/testcase/TSDnssdService.cs
tct-suite-vs/Tizen.Nsd.Tests/testcase/TSSsdpBrowser.cs
tct-suite-vs/Tizen.Nsd.Tests/testcase/TSSsdpService.cs

index 29cefbf..a2936bd 100755 (executable)
@@ -62,19 +62,24 @@ namespace Tizen.Network.Nsd.Tests
         [Description("Checks to create DnssdBrowser object with null parameter")]
         [Property("SPEC", "Tizen.Network.Nsd.DnssdBrowser.DnssdBrowser C")]
         [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "CONSTN, CONSTX")]
+        [Property("CRITERIA", "CONSTN")]
         [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
         public void DnssdBrowser_INIT_CHECK_EXCEPTION()
         {
             /* TEST CODE */
             try
             {
-                Assert.Throws<ArgumentException>(() => new DnssdBrowser(null));
+                var browser = new DnssdBrowser(null);
+                Assert.IsTrue(false, "ArgumentException or NotSupportedExceptin should be thrown");
             }
             catch (NotSupportedException)
             {
                 Assert.IsTrue(s_isDnssdSupported == false, "Invalid NotSupportedException");
             }
+            catch (ArgumentException)
+            {
+                Assert.IsTrue(true, "ArgumentException is thrown");
+            }
         }
     }
 }
index df083e6..a48720f 100755 (executable)
@@ -63,19 +63,24 @@ namespace Tizen.Network.Nsd.Tests
         [Description("Checks to create DnssdService object with null parameter")]
         [Property("SPEC", "Tizen.Network.Nsd.DnssdService.DnssdService C")]
         [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "CONSTN, CONSTX")]
+        [Property("CRITERIA", "CONSTN")]
         [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
         public void DnssdService_INIT_CHECK_EXCEPTION()
         {
             /* TEST CODE */
             try
             {
-                Assert.Throws<ArgumentException>(() => new DnssdService(null));
+                var service = new DnssdService(null);
+                Assert.IsTrue(false, "ArgumentException or NotSupportedExceptin should be thrown");
             }
             catch (NotSupportedException)
             {
                 Assert.IsTrue(s_isDnssdSupported == false, "Invalid NotSupportedException");
             }
+            catch (ArgumentException)
+            {
+                Assert.IsTrue(true);
+            }
         }
 
         [Test]
@@ -626,6 +631,10 @@ namespace Tizen.Network.Nsd.Tests
                 Assert.IsNotNull(dnssdService, "PRECONDITION: Failed to get DnssdService for testing.");
                 dnssdService.Dispose();
             }
+            catch (NotSupportedException)
+            {
+                Assert.IsTrue(s_isDnssdSupported == false, "Invalid NotSupportedException");
+            }
             catch (Exception e)
             {
                 Assert.Fail("There should be no exception " + e.ToString());
index 0ce65f9..5315b8b 100755 (executable)
@@ -60,19 +60,24 @@ namespace Tizen.Network.Nsd.Tests
         [Description("Checks to create SsdpBrowser object with null parameter")]
         [Property("SPEC", "Tizen.Network.Nsd.SsdpBrowser.SsdpBrowser C")]
         [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "CONSTN, CONSTX")]
+        [Property("CRITERIA", "CONSTN")]
         [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
         public void SsdpBrowser_INIT_CHECK_EXCEPTION()
         {
             /* TEST CODE */
             try
             {
-                Assert.Throws<ArgumentException>(() => new SsdpBrowser(null));
+                var browser = new SsdpBrowser(null);
+                Assert.IsTrue(false, "ArgumentException or NotSupportedExceptin should be thrown");
             }
             catch (NotSupportedException)
             {
                 Assert.IsTrue(s_isSsdpSupported == false, "Invalid NotSupportedException");
             }
+            catch (ArgumentException)
+            {
+                Assert.IsTrue(true, "ArgumentException is thrown");
+            }
         }
     }
 }
index 5486046..1d032b0 100755 (executable)
@@ -63,19 +63,24 @@ namespace Tizen.Network.Nsd.Tests
         [Description("Checks to create SsdpService object with null parameter")]
         [Property("SPEC", "Tizen.Network.Nsd.SsdpService.SsdpService C")]
         [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "CONSTN, CONSTX")]
+        [Property("CRITERIA", "CONSTN")]
         [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
         public void SsdpService_INIT_CHECK_EXCEPTION()
         {
             /* TEST CODE */
             try
             {
-                Assert.Throws<ArgumentException>(() => new SsdpService(null));
+                var service = new SsdpService(null);
+                Assert.IsTrue(false, "ArgumentException or NotSupportedExceptin should be thrown");
             }
             catch (NotSupportedException)
             {
                 Assert.IsTrue(s_isSsdpSupported == false, "Invalid NotSupportedException");
             }
+            catch (ArgumentException)
+            {
+                Assert.IsTrue(true, "ArgumentException is thrown");
+            }
         }
 
         [Test]
@@ -435,6 +440,10 @@ namespace Tizen.Network.Nsd.Tests
                 Assert.IsNotNull(ssdpService, "PRECONDITION: Failed to get SsdpService for testing.");
                 ssdpService.Dispose();
             }
+            catch (NotSupportedException)
+            {
+                Assert.IsTrue(s_isSsdpSupported == false, "Invalid NotSupportedException");
+            }
             catch (Exception e)
             {
                 Assert.Fail("There should be no exception " + e.ToString());