[Bluetooth][TCSACR-216] Add a tc for Dispose API 56/205756/1
authorWootak Jung <wootak.jung@samsung.com>
Thu, 9 May 2019 04:51:20 +0000 (13:51 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 9 May 2019 04:51:20 +0000 (13:51 +0900)
Change-Id: Ic9b287018114499e83f7b490946845eaec996df9

tct-suite-vs/Tizen.Bluetooth.Tests/testcase/TSBluetoothGattServer.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 55ddd4d..3ba62f4
@@ -73,6 +73,41 @@ namespace Tizen.Network.Bluetooth.Tests
 
         [Test]
         [Category("P1")]
+        [Description("Check whether Dispose works without throwing exception")]
+        [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothGattServer.Dispose M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Hyuk Lee, hyuk0512.lee@samsung.com")]
+        public void Dispose_CHECK_NO_EXCEPTION()
+        {
+            try
+            {
+                /* PRECONDITION
+                * 1. Enable Bluetooth
+                */
+                Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+                /* TEST CODE */
+                BluetoothGattServer server = BluetoothGattServer.CreateServer();
+                Assert.IsInstanceOf<BluetoothGattServer>(server, "Should return BluetoothGattServer instance.");
+
+                server.Dispose();
+            }
+            catch (Exception ex)
+            {
+                if (ex is NotSupportedException)
+                {
+                    Assert.IsTrue(_isBluetoothGattServerSupported == false, "Invalid NotSupportedException");
+                }
+                else
+                {
+                    Assert.Fail("Throwing exception " + ex.ToString());
+                }
+            }
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Check if RegisterGattService adds given service properly")]
         [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothGattServer.RegisterGattService M")]
         [Property("SPEC_URL", "-")]