From: Wootak Jung Date: Thu, 9 May 2019 04:51:20 +0000 (+0900) Subject: [Bluetooth][TCSACR-216] Add a tc for Dispose API X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F205756%2F1;p=test%2Ftct%2Fcsharp%2Fapi.git [Bluetooth][TCSACR-216] Add a tc for Dispose API Change-Id: Ic9b287018114499e83f7b490946845eaec996df9 --- diff --git a/tct-suite-vs/Tizen.Bluetooth.Tests/testcase/TSBluetoothGattServer.cs b/tct-suite-vs/Tizen.Bluetooth.Tests/testcase/TSBluetoothGattServer.cs old mode 100755 new mode 100644 index 55ddd4d..3ba62f4 --- a/tct-suite-vs/Tizen.Bluetooth.Tests/testcase/TSBluetoothGattServer.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Tests/testcase/TSBluetoothGattServer.cs @@ -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(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", "-")]