From: Wootak Jung Date: Fri, 21 Aug 2020 01:29:40 +0000 (+0900) Subject: [Bluetooth][Non-ACR] Add StartLeScan negative TC X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=534f821d8231ee078bfa604bf09e128fdffb1dbc;p=test%2Ftct%2Fcsharp%2Fapi.git [Bluetooth][Non-ACR] Add StartLeScan negative TC Change-Id: I99c1b1f390d48c682578795c329c7b4c5a1ecd31 Signed-off-by: Wootak Jung --- diff --git a/tct-suite-vs/Tizen.Bluetooth.Tests/testcase/TSBluetoothAdapter.cs b/tct-suite-vs/Tizen.Bluetooth.Tests/testcase/TSBluetoothAdapter.cs index a6e097ee2..b81de0399 100644 --- a/tct-suite-vs/Tizen.Bluetooth.Tests/testcase/TSBluetoothAdapter.cs +++ b/tct-suite-vs/Tizen.Bluetooth.Tests/testcase/TSBluetoothAdapter.cs @@ -793,5 +793,45 @@ namespace Tizen.Network.Bluetooth.Tests } } } + + [Test] + [Category("P2")] + [Description("Check if StartLeScan returns proper error")] + [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothAdapter.StartLeScan M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Wootak Jung, wootak.jung@samsung.com")] + [Property("COVPARAM", "BluetoothLeScanMode")] + public static async Task StartLeScan_MODE_CHECK_EXCEPTION() + { + try + { + /* PRECONDITION + * 1. Enable Bluetooth + */ + if (!BluetoothAdapter.IsBluetoothEnabled) + { + Assert.Fail("Bluetooth is not enabled"); + return; + } + + /* TEST CODE */ + Assert.Throws(() => + { + BluetoothAdapter.StartLeScan((BluetoothLeScanMode)123); + }, "StartLeScan should throw InvalidOperationException"); + } + catch (Exception ex) + { + if (ex is NotSupportedException) + { + Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException"); + } + else + { + Assert.Fail("Throwing exception " + ex.ToString()); + } + } + } } }