}
}
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetAppearance method of BluetoothLeDevice and it throws InvalidOperationException when the Bluetooth LE is not enabled.")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothLeDevice.GetAppearance M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Open Bluetooth in Settings on test device and turn on Bluetooth")]
+ [Precondition(2, "Run GATT Server test case on another device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "TC should pass automatically.")]
+ [Postcondition(1, "NA")]
+ public async Task GetAppearance_RETURN_VALUE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if BT LE feature is not supported in Manual TC */
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetAppearance_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (leDevice == null)
+ {
+ leDevice = await BluetoothSetup.LeScanSetup();
+ Assert.IsNotNull(leDevice, "Precondition failed: Le device instance should not be null");
+ }
+
+ // TEST CODE
+ int appearance = leDevice.GetAppearance(BluetoothLePacketType.BluetoothLeAdvertisingPacket);
+ if (appearance == -1)
+ {
+ appearance = leDevice.GetAppearance(BluetoothLePacketType.BluetoothLeScanResponsePacket);
+ Assert.AreNotEqual(appearance, -1, "[TestCase][GetAppearance_RETURN_VALUE] Appearance not found in any packet data: FAIL");
+ }
+
+ Assert.IsInstanceOf<int>(appearance);
+ Log.Info("TCT", "[TestCase][GetAppearance_RETURN_VALUE] Pass" + appearance);
+ }
+ catch (NotSupportedException)
+ {
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetAppearance_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (TypeInitializationException e)
+ {
+ if (isBluetoothLeSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+ {
+ BluetoothHelper.DisplayLabel("GetAppearance_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetDeviceName method of BluetoothLeDevice and it throws InvalidOperationException when the Bluetooth LE is not enabled.")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothLeDevice.GetDeviceName M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Open Bluetooth in Settings on test device and turn on Bluetooth")]
+ [Precondition(2, "Run GATT Server test case on another device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "TC should pass automatically.")]
+ [Postcondition(1, "NA")]
+ public async Task GetDeviceName_RETURN_VALUE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if BT LE feature is not supported in Manual TC */
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetDeviceName_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (leDevice == null)
+ {
+ leDevice = await BluetoothSetup.LeScanSetup();
+ Assert.IsNotNull(leDevice, "Precondition failed: Le device instance should not be null");
+ }
+
+ // TEST CODE
+ string deviceName = leDevice.GetDeviceName(BluetoothLePacketType.BluetoothLeAdvertisingPacket);
+ if (deviceName == null)
+ {
+ deviceName = leDevice.GetDeviceName(BluetoothLePacketType.BluetoothLeScanResponsePacket);
+ Assert.IsNotNull(deviceName, "[TestCase][GetDeviceName_RETURN_VALUE] Device name not found in any packet data FAIL");
+ }
+
+ Assert.IsInstanceOf<string>(deviceName);
+ Log.Info("TCT", "[TestCase][GetDeviceName_RETURN_VALUE] Pass : Device name is : " + deviceName);
+ }
+ catch (NotSupportedException)
+ {
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetDeviceName_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (TypeInitializationException e)
+ {
+ if (isBluetoothLeSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+ {
+ BluetoothHelper.DisplayLabel("GetDeviceName_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetManufacturerData method of BluetoothLeDevice and it throws InvalidOperationException when the Bluetooth LE is not enabled.")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothLeDevice.GetManufacturerData M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Open Bluetooth in Settings on test device and turn on Bluetooth")]
+ [Precondition(2, "Run GATT Server test case on another device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "TC should pass automatically.")]
+ [Postcondition(1, "NA")]
+ public async Task GetManufacturerData_RETURN_VALUE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if BT LE feature is not supported in Manual TC */
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetManufacturerData_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (leDevice == null)
+ {
+ leDevice = await BluetoothSetup.LeScanSetup();
+ Assert.IsNotNull(leDevice, "Precondition failed: Le device instance should not be null");
+ }
+
+ // TEST CODE
+ ManufacturerData data = leDevice.GetManufacturerData(BluetoothLePacketType.BluetoothLeAdvertisingPacket);
+ if (data == null)
+ {
+ data = leDevice.GetManufacturerData(BluetoothLePacketType.BluetoothLeScanResponsePacket);
+ Assert.IsNotNull(data, "[TestCase][GetManufacturerData_RETURN_VALUE] No manufacturer data present in either packet type : FAIL");
+ }
+
+ Assert.IsNotNull(data.Data, "Data property of ManufacturerData is not proper");
+ Assert.IsInstanceOf<int>(data.DataLength, "DataLength property of ManufacturerData is not proper");
+ Assert.IsInstanceOf<int>(data.Id, "Id property of ManufacturerData is not proper");
+ Log.Info("TCT", "[TestCase][GetManufacturerData_RETURN_VALUE] PASS: Found Manufacturer data Id : " + data.Id + " Length : " + data.DataLength);
+ }
+ catch (NotSupportedException)
+ {
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetManufacturerData_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (TypeInitializationException e)
+ {
+ if (isBluetoothLeSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+ {
+ BluetoothHelper.DisplayLabel("GetManufacturerData_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetServiceSolicitationUuid method of BluetoothLeDevice and it throws InvalidOperationException when the Bluetooth LE is not enabled.")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothLeDevice.GetServiceSolicitationUuid M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Open Bluetooth in Settings on test device and turn on Bluetooth")]
+ [Precondition(2, "Run GATT Server test case on another device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "TC should pass automatically.")]
+ [Postcondition(1, "NA")]
+ public async Task GetServiceSolicitationUuid_RETURN_VALUE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if BT LE feature is not supported in Manual TC */
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetServiceSolicitationUuid_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (leDevice == null)
+ {
+ leDevice = await BluetoothSetup.LeScanSetup();
+ Assert.IsNotNull(leDevice, "Precondition failed: Le device instance should not be null");
+ }
+
+ // TEST CODE
+ IEnumerable<string> ssuuid = leDevice.GetServiceSolicitationUuid(BluetoothLePacketType.BluetoothLeAdvertisingPacket);
+ if (ssuuid == null)
+ {
+ ssuuid = leDevice.GetServiceSolicitationUuid(BluetoothLePacketType.BluetoothLeScanResponsePacket);
+ Assert.IsNotNull(ssuuid, "[TestCase][GetServiceSolicitationUuid_RETURN_VALUE] No SSUUID data found in either packet type : FAIL");
+ }
+
+ Assert.AreNotEqual(ssuuid.Count(), 0, "Count of ssuuid is 0");
+ foreach (string uuid in ssuuid)
+ {
+ Assert.IsInstanceOf<string>(uuid, "uuid is not string");
+ Log.Info("TCT", "[TestCase][GetServiceSolicitationUuid_RETURN_VALUE] UUID is : " + uuid);
+ }
+ Log.Info("TCT", "[TestCase][GetServiceSolicitationUuid_RETURN_VALUE] PASS");
+ }
+ catch (NotSupportedException)
+ {
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetServiceSolicitationUuid_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (TypeInitializationException e)
+ {
+ if (isBluetoothLeSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+ {
+ BluetoothHelper.DisplayLabel("GetServiceSolicitationUuid_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetServiceUuid method of BluetoothLeDevice and it throws InvalidOperationException when the Bluetooth LE is not enabled.")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothLeDevice.GetServiceUuid M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Open Bluetooth in Settings on test device and turn on Bluetooth")]
+ [Precondition(2, "Run GATT Server test case on another device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "TC should pass automatically.")]
+ [Postcondition(1, "NA")]
+ public async Task GetServiceUuid_RETURN_VALUE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if BT LE feature is not supported in Manual TC */
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetServiceUuid_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (leDevice == null)
+ {
+ leDevice = await BluetoothSetup.LeScanSetup();
+ Assert.IsNotNull(leDevice, "Precondition failed: Le device instance should not be null");
+ }
+
+ // TEST CODE
+ IEnumerable<string> svcuuid = leDevice.GetServiceUuid(BluetoothLePacketType.BluetoothLeAdvertisingPacket);
+ if (svcuuid == null)
+ {
+ svcuuid = leDevice.GetServiceUuid(BluetoothLePacketType.BluetoothLeScanResponsePacket);
+ Assert.IsNotNull(svcuuid, "[TestCase][GetServiceUuid_RETURN_VALUE] No SVC UUID found in either packet type : FAIL");
+ }
+
+ Assert.AreNotEqual(svcuuid.Count(), 0, "Count of svcuuid is 0");
+ foreach (string uuid in svcuuid)
+ {
+ Assert.IsInstanceOf<string>(uuid, "uuid is not string");
+ Log.Info("TCT", "[TestCase][GetServiceUuid_RETURN_VALUE] UUID is : " + uuid);
+ }
+ Log.Info("TCT", "[TestCase][GetServiceUuid_RETURN_VALUE] PASS");
+ }
+ catch (NotSupportedException)
+ {
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetServiceUuid_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (TypeInitializationException e)
+ {
+ if (isBluetoothLeSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+ {
+ BluetoothHelper.DisplayLabel("GetServiceUuid_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetTxPowerLevel method of BluetoothLeDevice and it throws InvalidOperationException when the Bluetooth LE is not enabled.")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothLeDevice.GetTxPowerLevel M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Open Bluetooth in Settings on test device and turn on Bluetooth")]
+ [Precondition(2, "Run GATT Server test case on another device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "TC should pass automatically.")]
+ [Postcondition(1, "NA")]
+ public async Task GetTxPowerLevel_RETURN_VALUE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if BT LE feature is not supported in Manual TC */
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetTxPowerLevel_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (leDevice == null)
+ {
+ leDevice = await BluetoothSetup.LeScanSetup();
+ Assert.IsNotNull(leDevice, "Precondition failed: Le device instance should not be null");
+ }
+
+ // TEST CODE
+ int txLevel = leDevice.GetTxPowerLevel(BluetoothLePacketType.BluetoothLeAdvertisingPacket);
+ if (txLevel == -1)
+ {
+ txLevel = leDevice.GetTxPowerLevel(BluetoothLePacketType.BluetoothLeScanResponsePacket);
+ Assert.AreNotEqual(txLevel, -1, "[TestCase][GetTxPowerLevel_RETURN_VALUE] - No TxPowerLevel data found in either packet type: FAIL");
+ }
+
+ Assert.IsInstanceOf<int>(txLevel, "BluetoothLeDevice TxPowerLevel is not valid");
+ Log.Info("TCT", "[TestCase][GetTxPowerLevel_RETURN_VALUE] Pass - Tx Power Level is : " + txLevel);
+ }
+ catch (NotSupportedException)
+ {
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetTxPowerLevel_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (TypeInitializationException e)
+ {
+ if (isBluetoothLeSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+ {
+ BluetoothHelper.DisplayLabel("GetTxPowerLevel_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetServiceDataList method of BluetoothLeDevice and it throws InvalidOperationException when the Bluetooth LE is not enabled.")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothLeDevice.GetServiceDataList M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Open Bluetooth in Settings on test device and turn on Bluetooth")]
+ [Precondition(2, "Run GATT Server test case on another device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "TC should pass automatically.")]
+ [Postcondition(1, "NA")]
+ public async Task GetServiceDataList_RETURN_VALUE()
+ {
+ try
+ {
+ /* We can't occupy the precondition, if BT LE feature is not supported in Manual TC */
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetServiceDataList_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (leDevice == null)
+ {
+ leDevice = await BluetoothSetup.LeScanSetup();
+ Assert.IsNotNull(leDevice, "Precondition failed: Le device instance should not be null");
+ }
+
+ // TEST CODE
+ IEnumerable<BluetoothLeServiceData> serviceList = leDevice.GetServiceDataList(BluetoothLePacketType.BluetoothLeAdvertisingPacket);
+ if (serviceList == null)
+ {
+ serviceList = leDevice.GetServiceDataList(BluetoothLePacketType.BluetoothLeScanResponsePacket);
+ Assert.IsNotNull(serviceList, "[TestCase][GetServiceDataList_RETURN_VALUE Property] No GetServiceDataList found in either packet type : FAIL");
+ }
+
+ Assert.AreNotEqual(serviceList.Count(), 0, "Count of serviceList is 0");
+ foreach (BluetoothLeServiceData data in serviceList)
+ {
+ Assert.IsNotNull(data.ServiceData, "ServiceData is null");
+ Assert.IsInstanceOf<int>(data.ServiceDataLength, "ServiceDataLength is not int");
+ Assert.IsInstanceOf<string>(data.ServiceUuid, "ServiceUuid is not string");
+ Log.Info("TCT", "[TestCase][GetServiceDataList_RETURN_VALUE] PASS: Retrieved service data list UUID : " + data.ServiceUuid + " length is " + data.ServiceDataLength);
+ }
+ }
+ catch (NotSupportedException)
+ {
+ if (isBluetoothLeSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetServiceDataList_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (TypeInitializationException e)
+ {
+ if (isBluetoothLeSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
+ {
+ BluetoothHelper.DisplayLabel("GetServiceDataList_RETURN_VALUE");
+ await ManualTest.WaitForConfirm();
+ }
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
+ }
}
}