}
}
}
+
+ [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<InvalidOperationException>(() =>
+ {
+ 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());
+ }
+ }
+ }
}
}