+++ /dev/null
-using System;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.System;
-using Xamarin.Forms;
-using BluetoothNetworkUtils;
-
-namespace Tizen.Network.Bluetooth.Tests
-{
- [TestFixture]
- [Description("AuthorizationChangedEventArgs Tests")]
- public class AuthorizationChangedEventArgsTests
- {
- static bool flagDiscovery = false;
- static bool flagBond = false;
- static bool isBluetoothSupported = false;
- static BluetoothDevice bondedDevice;
- static BluetoothDevice foundDevice;
- static string address;
- public static string remote_addr = PreconditionUtils.GetBtAddress();
- public static string default_remote_addr = PreconditionUtils.GetDefaultAddress();
-
- [SetUp]
- public static void Init()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST");
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out isBluetoothSupported);
- }
- [TearDown]
- public static void Destroy()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST");
- }
-
- public static async Task WaitForDiscoveryFlag()
- {
- int count = 0;
- while(true)
- {
- await Task.Delay(1000);
- count++;
- if (flagDiscovery)
- break;
- if (count == 8)
- break;
- }
- }
-
- public static async Task WaitForBondedFlag()
- {
- int count = 0;
- while(true)
- {
- await Task.Delay(1000);
- count++;
- if (flagBond)
- break;
- if (count == 8)
- break;
- }
- }
-
- public static async Task Setup()
- {
- if (bondedDevice != null)
- return;
-
- bondedDevice = BluetoothAdapter.GetBondedDevice(remote_addr);
-
- if (bondedDevice != null)
- return;
-
- BluetoothAdapter.DiscoveryStateChanged += EventHandlerDiscoveryChanged;
- BluetoothAdapter.StartDiscovery();
- await WaitForDiscoveryFlag();
-
- if (BluetoothAdapter.IsDiscoveryInProgress)
- {
- BluetoothAdapter.StopDiscovery ();
- await Task.Delay(1000);
- }
-
- foundDevice.BondCreated += EventHandlerBondCreated;
- foundDevice.CreateBond();
- }
-
- public static void EventHandlerDiscoveryChanged(object sender, DiscoveryStateChangedEventArgs e)
- {
- if (e.DiscoveryState == BluetoothDeviceDiscoveryState.Found)
- {
- if (remote_addr.Equals(default_remote_addr))
- {
- if (flagDiscovery == true)
- return;
-
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Use the first found device");
- }
- else if (e.DeviceFound.Address.Equals(remote_addr))
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Found the matching device: " + e.DeviceFound.Address);
- }
- else
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Exception: " + e.DeviceFound.Address);
- return;
- }
-
- foundDevice = e.DeviceFound;
- flagDiscovery = true;
- }
- }
-
- public static void EventHandlerBondCreated(object sender, BondCreatedEventArgs e)
- {
- if (e.Device != null && e.Result == 0)
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Paired with " + e.Device.Address);
- flagBond = true;
- bondedDevice = e.Device;
- }
- }
-
- public static async Task SetupAuthorizationTest(BluetoothAuthorizationType value)
- {
- EventHandler<AuthorizationChangedEventArgs> authorizationChangedCallback = null;
-
- // TEST CODE
- authorizationChangedCallback = (sender, e) => {
- address = e.DeviceAddress;
- if (e.Authorization == value && address != null)
- {
- ManualTest.Confirm();
- }
- };
- bondedDevice.AuthorizationChanged += authorizationChangedCallback;
- bondedDevice.SetAuthorization(value);
- await ManualTest.WaitForConfirm();
-
- // POSTCONDITION
- Assert.AreEqual(bondedDevice.Address, address, "Address of bonded device must be same as address of device whose authorization type is changed");
- bondedDevice.AuthorizationChanged -= authorizationChangedCallback;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Authorization. Check if Authorization has proper value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.AuthorizationChangedEventArgs.Authorization A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device")]
- [Step(1, "Tap the Run button")]
- [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device to create bond between them")]
- [Postcondition(1, "NA")]
- public static async Task Authorization_GET_ENUM_ALL()
- {
- try
- {
- if (!flagBond)
- {
- await Setup();
- Assert.IsNotNull(bondedDevice, "Precondition failed: Bonded device should not be null");
- await WaitForBondedFlag();
- bondedDevice.BondCreated -= EventHandlerBondCreated;
- }
-
- //TEST CODE
-
- //Test with enum value : BluetoothAuthorizationType.Authorized
- await SetupAuthorizationTest(BluetoothAuthorizationType.Authorized);
-
- //Test with enum value : BluetoothAuthorizationType.Unauthorized
- await SetupAuthorizationTest(BluetoothAuthorizationType.Unauthorized);
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false)
- {
- BluetoothHelper.DisplayLabel("Authorization_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("Authorization_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test DeviceAddress. Check if DeviceAddress has proper value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.AuthorizationChangedEventArgs.DeviceAddress A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device")]
- [Step(1, "Tap the Run button")]
- [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device to create bond between them")]
- [Postcondition(1, "NA")]
- public static async Task DeviceAddress_READ_ONLY()
- {
- try
- {
- if (!flagBond)
- {
- await Setup();
- await WaitForBondedFlag();
- Assert.IsNotNull(bondedDevice, "Precondition failed: Bonded device should not be null");
- bondedDevice.BondCreated -= EventHandlerBondCreated;
- }
-
- if (bondedDevice.IsAuthorized == true)
- {
- bondedDevice.SetAuthorization(BluetoothAuthorizationType.Unauthorized);
- await Task.Delay(200);
- }
-
- //TEST CODE
-
- // Test with enum value : BluetoothAuthorizationType.Authorized
- await SetupAuthorizationTest(BluetoothAuthorizationType.Authorized);
-
- // Test with enum value : BluetoothAuthorizationType.Unauthorized
- await SetupAuthorizationTest(BluetoothAuthorizationType.Unauthorized);
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false)
- {
- BluetoothHelper.DisplayLabel("Authorization_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("Authorization_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-using System;
-using System.Threading.Tasks;
-using System.Linq;
-using System.Collections.Generic;
-using BluetoothNetworkUtils;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Collections.ObjectModel;
-using Tizen.System;
-using Xamarin.Forms;
-
-namespace Tizen.Network.Bluetooth.Tests
-{
- [TestFixture]
- [Description("BluetoothClass Tests")]
- public class BluetoothClassTests
- {
- static BluetoothDevice deviceInstance = null;
- static bool flagDiscovery = false;
- static bool isBluetoothSupported = false;
- static bool isBluetoothLeSupported = false;
-
- [SetUp]
- public static void Init()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST");
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out isBluetoothSupported);
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth.le", out isBluetoothLeSupported);
- }
- [TearDown]
- public static void Destroy()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST");
- }
-
- public static async Task DiscoverySetup()
- {
- BluetoothAdapter.DiscoveryStateChanged += EventHandlerDiscoveryChanged;
- BluetoothAdapter.StartDiscovery();
- await WaitForDiscoveryflag();
- BluetoothAdapter.StopDiscovery();
- await Task.Delay(8000);
- BluetoothAdapter.DiscoveryStateChanged -= EventHandlerDiscoveryChanged;
- }
- public static async Task WaitForDiscoveryflag()
- {
- int count = 0;
- while (true)
- {
- await Task.Delay(1000);
- count++;
- if (flagDiscovery)
- break;
- if (count == 8)
- break;
- }
- }
-
- public static void EventHandlerDiscoveryChanged(object sender, DiscoveryStateChangedEventArgs e)
- {
- if (e.DiscoveryState == BluetoothDeviceDiscoveryState.Found)
- {
- deviceInstance = e.DeviceFound;
- flagDiscovery = true;
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test MajorDeviceClassType. Check the MajorDeviceClassType value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothClass.MajorDeviceClassType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task MajorDeviceClassType_GET_ENUM_ALL()
- {
- try
- {
- if (deviceInstance == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(deviceInstance, "DeviceFound during discovery should not be null");
- }
-
- // TEST CODE
- Assert.IsInstanceOf<BluetoothMajorDeviceClassType>(deviceInstance.Class.MajorDeviceClassType, "MajorDeviceClassType value is not of type BluetoothMajorDeviceClassType");
- Assert.IsNotNull(deviceInstance.Class.MajorDeviceClassType, "MajorDeviceClassType value is null");
- bool result = Enum.IsDefined(typeof(BluetoothMajorDeviceClassType), deviceInstance.Class.MajorDeviceClassType);
- Assert.True(result, "MajorDeviceClassType value is not defined in enum");
-
- // Since the BluetoothMajorDeviceClassType value is coming from capi framework in callback, it is not possible to create test case for all enum values
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("MajorDeviceClassType_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("MajorDeviceClassType_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test MajorServiceClassMask. Check the MajorServiceClassMask value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothClass.MajorServiceClassMask A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task MajorServiceClassMask_PROPERTY_READ_ONLY()
- {
- try
- {
- if (deviceInstance == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(deviceInstance, "DeviceFound during discovery should not be null");
- }
-
- // TEST CODE
- Assert.IsInstanceOf<int>(deviceInstance.Class.MajorServiceClassMask, "MajorServiceClassMask value is not of type int");
- Assert.IsNotNull(deviceInstance.Class.MajorServiceClassMask, "MajorServiceClassMask value is null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("MajorServiceClassMask_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("MajorServiceClassMask_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test MinorDeviceClassType. Check the MinorDeviceClassType value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothClass.MinorDeviceClassType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task MinorDeviceClassType_GET_ENUM_ALL()
- {
- try
- {
- if (deviceInstance == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(deviceInstance, "DeviceFound during discovery should not be null");
- }
-
- // TEST CODE
- Assert.IsInstanceOf<BluetoothMinorDeviceClassType>(deviceInstance.Class.MinorDeviceClassType, "MinorDeviceClassType value is not of type BluetoothMinorDeviceClassType");
- Assert.IsNotNull(deviceInstance.Class.MinorDeviceClassType, "MinorDeviceClassType value is null");
- bool result = Enum.IsDefined(typeof(BluetoothMinorDeviceClassType), deviceInstance.Class.MinorDeviceClassType);
- Assert.True(result, "MinorDeviceClassType value is not defined in enum");
-
- // Since the BluetoothMinorDeviceClassType value is coming from capi framework in callback, it is not possible to create test case for all enum values
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("MinorDeviceClassType_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("MinorDeviceClassType_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
--- /dev/null
+using System;
+using System.Threading.Tasks;
+using System.Linq;
+using System.Collections.Generic;
+using BluetoothNetworkUtils;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System.Collections.ObjectModel;
+using Tizen.System;
+using Xamarin.Forms;
+
+namespace Tizen.Network.Bluetooth.Tests
+{
+ [TestFixture]
+ [Description("BluetoothDevice Tests")]
+ public class BluetoothDeviceTests
+ {
+ static bool flagDiscovery = false;
+ static bool flagBondCreated = false;
+ static BluetoothDevice foundDevice = null;
+ static BluetoothDevice bondedDevice = null;
+ static bool isBluetoothSupported = false;
+ static string remote_addr = PreconditionUtils.GetBtAddress();
+
+ static bool pass_GetMaskFromUuid_RETURN_SERVICE_MASK = false;
+ static bool pass_Address_PROPERTY_READ_ONLY = false;
+ static bool pass_Name_PROPERTY_READ_ONLY = false;
+ static bool pass_AppearanceType_GET_ENUM_ALL = false;
+ static bool pass_Rssi_PROPERTY_READ_ONLY = false;
+ static bool pass_Class_PROPERTY_READ_ONLY = false;
+ static bool pass_ServiceUuidList_PROPERTY_READ_ONLY = false;
+ static bool pass_ServiceCount_PROPERTY_READ_ONLY = false;
+ static bool pass_IsPaired_PROPERTY_READ_ONLY = false;
+ static bool pass_ManufacturerDataLength_PROPERTY_READ_ONLY = false;
+ static bool pass_ManufacturerData_PROPERTY_READ_ONLY = false;
+ static bool pass_GetProfile_RETURN_GET_INSTANCE = false;
+ static bool pass_CreateBond_RETURN_BOND_CREATED = false;
+ static bool pass_DestroyBond_RETURN_BOND_DESTROYED = false;
+ static bool pass_CancelBonding_RETURN_CANCEL_BOND = false;
+ static bool pass_BondCreated_CHECK_EVENT = false;
+ static bool pass_BondDestroyed_CHECK_EVENT = false;
+ static bool pass_SetAlias_RETURN_ALIAS_PAIRED_DEVICE = false;
+ static bool pass_SetAuthorization_SET_ENUM_ALL = false;
+ static bool pass_StartServiceSearch_RETURN_SERVICE_SEARCH = false;
+ static bool pass_GetConnectedProfiles_RETURN_VALUE_PROFILES = false;
+ static bool pass_IsProfileConnected_RETURN_VALUE_CONNECTED = false;
+ static bool pass_ConnectionStateChanged_CHECK_EVENT = false;
+ static bool pass_AuthorizationChanged_CHECK_EVENT = false;
+ static bool pass_ServiceSearched_CHECK_EVENT = false;
+ static bool pass_CreateSocket_RETURN_TYPE = false;
+ static bool pass_IsConnected_PROPERTY_READ_ONLY = false;
+ static bool pass_IsAuthorized_PROPERTY_READ_ONLY = false;
+ static bool pass_Authorization_GET_ENUM_ALL = false;
+ static bool pass_DeviceAddress_READ_ONLY = false;
+ static bool pass_MajorDeviceClassType_GET_ENUM_ALL = false;
+ static bool pass_MajorServiceClassMask_PROPERTY_READ_ONLY = false;
+ static bool pass_MinorDeviceClassType_GET_ENUM_ALL = false;
+ static bool pass_Address_BluetoothDeviceConnectionData_PROPERTY_READ_ONLY = false;
+ static bool pass_LinkType_BluetoothDeviceConnectionData_GET_ENUM_ALL = false;
+ static bool pass_DisconnectReason_BluetoothDeviceConnectionData_GET_ENUM_ALL = false;
+ static bool pass_DeviceAddress_BluetoothDeviceSdpData_PROPERTY_READ_ONLY = false;
+ static bool pass_ServiceUuid_BluetoothDeviceSdpData_PROPERTY_READ_ONLY = false;
+ static bool pass_BluetoothProfile_INIT = false;
+ static bool pass_Result_BondCreatedEventArgs_READ_ONLY = false;
+ static bool pass_Device_BondCreatedEventArgs_READ_ONLY = false;
+ static bool pass_Result_BondDestroyedEventArgs_READ_ONLY = false;
+ static bool pass_DeviceAddress_BondDestroyedEventArgs_READ_ONLY = false;
+ static bool pass_IsConnected_READ_ONLY = false;
+ static bool pass_ConnectionData_READ_ONLY = false;
+ static bool pass_SdpData_ServiceSearchedEventArgs_READ_ONLY = false;
+ static bool pass_Result_ServiceSearchedEventArgs_READ_ONLY = false;
+
+ [SetUp]
+ public static void Init()
+ {
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST");
+ Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out isBluetoothSupported);
+ flagDiscovery = false;
+ }
+ [TearDown]
+ public static void Destroy()
+ {
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST");
+ }
+
+ public static async Task WaitForBondflag()
+ {
+ int count = 0;
+ while(true)
+ {
+ await Task.Delay(200);
+ count++;
+ if (flagBondCreated)
+ break;
+ if (count == 100)
+ break;
+ }
+ }
+
+ public static async Task WaitForDiscoveryflag()
+ {
+ int count = 0;
+ while(true)
+ {
+ await Task.Delay(200);
+ count++;
+ if (flagDiscovery)
+ break;
+ if (count == 40)
+ break;
+ }
+ }
+
+ public static void BondingSetupBondCreated(object sender, BondCreatedEventArgs e)
+ {
+ if (e.Device != null && e.Result == 0)
+ {
+ flagBondCreated = true;
+ bondedDevice = e.Device;
+ }
+ }
+
+ public static void EventHandlerDiscoveryChanged(object sender, DiscoveryStateChangedEventArgs e)
+ {
+ if (e.DiscoveryState == BluetoothDeviceDiscoveryState.Found)
+ {
+ if (flagDiscovery == true)
+ return;
+
+ if (e.DeviceFound.Address.Equals(remote_addr))
+ {
+ foundDevice = e.DeviceFound;
+
+ LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Found the matching device: " + foundDevice.Address);
+ flagDiscovery = true;
+ }
+ }
+ }
+
+ public static async Task DiscoverySetup()
+ {
+ BluetoothAdapter.DiscoveryStateChanged += EventHandlerDiscoveryChanged;
+
+ if (BluetoothAdapter.IsDiscoveryInProgress)
+ {
+ BluetoothAdapter.StopDiscovery();
+ await Task.Delay(1000);
+ }
+
+ BluetoothAdapter.StartDiscovery();
+ await WaitForDiscoveryflag();
+
+ if (BluetoothAdapter.IsDiscoveryInProgress)
+ {
+ BluetoothAdapter.StopDiscovery();
+ await Task.Delay(1000);
+ }
+ BluetoothAdapter.DiscoveryStateChanged -= EventHandlerDiscoveryChanged;
+ }
+
+ public static async Task BondingSetup()
+ {
+ foundDevice.BondCreated += BondingSetupBondCreated;
+ foundDevice.CreateBond();
+ await WaitForBondflag();
+
+ foundDevice.BondCreated -= BondingSetupBondCreated;
+ }
+
+ public async Task DeviceCombine_TEST()
+ {
+ try
+ {
+ bondedDevice = BluetoothAdapter.GetBondedDevice(remote_addr);
+ }
+ catch (Exception ex)
+ {
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Device is not bonded : " + ex.ToString());
+ }
+
+ try
+ {
+ bool result = false;
+
+ /* Prepare the destroy bond procedure */
+ if (bondedDevice == null)
+ {
+ await DiscoverySetup();
+ Assert.IsNotNull (foundDevice, "found device should not be null");
+
+ await BondingSetup();
+ flagBondCreated = false;
+
+ /* Wait for ACL disconnect */
+ await Task.Delay(6000);
+ }
+
+ Assert.IsNotNull (bondedDevice, "Bonded device should not be null");
+
+ EventHandler<BondDestroyedEventArgs> EventHandlerBondDestroyed = null;
+
+ EventHandlerBondDestroyed = (sender, e) => {
+ /* PASS condition for pass_Result_BondDestroyedEventArgs_READ_ONLY */
+ Assert.IsTrue((int)e.Result == 0, "BondDestroyed event is not working properly");
+ pass_Result_BondDestroyedEventArgs_READ_ONLY = true;
+
+ /* PASS condition for pass_DeviceAddress_BondDestroyedEventArgs_READ_ONLY */
+ Assert.IsNotNull(e.DeviceAddress, "Destroyed bond device address should not be null");
+ pass_DeviceAddress_BondDestroyedEventArgs_READ_ONLY = true;
+
+ /* PASS condition for pass_BondDestroyed_CHECK_EVENT */
+ pass_BondDestroyed_CHECK_EVENT = true;
+ };
+
+ /* PASS condition for pass_DestroyBond_RETURN_BOND_DESTROYED */
+ bondedDevice.BondDestroyed += EventHandlerBondDestroyed;
+ bondedDevice.DestroyBond();
+ pass_DestroyBond_RETURN_BOND_DESTROYED = true;
+
+ await Task.Delay(2000);
+
+ bondedDevice.BondDestroyed -= EventHandlerBondDestroyed;
+
+ EventHandler<DeviceConnectionStateChangedEventArgs> EventHandlerConnectionStateChanged = null;
+ EventHandlerConnectionStateChanged = (sender, e) => {
+ /* PASS condition for pass_ConnectionStateChanged_CHECK_EVENT */
+ Assert.IsInstanceOf<bool>(e.IsConnected, "IsConnected parameter should be of type bool");
+ pass_IsConnected_READ_ONLY = true;
+
+ /* PASS condition for pass_ConnectionData_READ_ONLY */
+ Assert.IsNotNull(e.ConnectionData, "ConnectionData should not be null");
+ pass_ConnectionData_READ_ONLY = true;
+
+ /* PASS condition for pass_ConnectionStateChanged_CHECK_EVENT */
+ pass_ConnectionStateChanged_CHECK_EVENT = true;
+
+ /* PASS condition for pass_Address_BluetoothDeviceConnectionData_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<string>(e.ConnectionData.Address, "Address value is not of type string");
+ Assert.IsNotNull(e.ConnectionData.Address, "Address value is null");
+ pass_Address_BluetoothDeviceConnectionData_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_LinkType_BluetoothDeviceConnectionData_GET_ENUM_ALL */
+ Assert.IsInstanceOf<BluetoothConnectionLinkType>(e.ConnectionData.LinkType, "LinkType value is not of type BluetoothConnectionLinkType");
+ Assert.IsNotNull(e.ConnectionData.LinkType, "connectionData.LinkType is null");
+ result = Enum.IsDefined(typeof(BluetoothConnectionLinkType), e.ConnectionData.LinkType);
+ Assert.IsTrue(result, "LinkType value is not defined in BluetoothConnectionLinkType enum");
+ // Since BluetoothConnectionLinkType value is coming from capi framework in callback, it is not possible to create test case for all enum values
+ pass_LinkType_BluetoothDeviceConnectionData_GET_ENUM_ALL = true;
+
+ /* PASS condition for pass_DisconnectReason_BluetoothDeviceConnectionData_GET_ENUM_ALL */
+ Assert.IsInstanceOf<BluetoothDisconnectReason>(e.ConnectionData.DisconnectReason, "DisconnectReason is not of type BluetoothDisconnectReason");
+ Assert.IsNotNull(e.ConnectionData.DisconnectReason, "connectionData.DisconnectReason is null");
+ result = Enum.IsDefined(typeof(BluetoothDisconnectReason), e.ConnectionData.DisconnectReason);
+ Assert.IsTrue(result, "DisconnectReason value is not defined in BluetoothDisconnectReason enum");
+ // Since BluetoothDisconnectReason value is coming from capi framework in callback, it is not possible to create test case for all enum values
+ pass_DisconnectReason_BluetoothDeviceConnectionData_GET_ENUM_ALL = true;
+ };
+
+ bondedDevice.ConnectionStateChanged += EventHandlerConnectionStateChanged;
+
+ EventHandler<BondCreatedEventArgs> EventHandlerBondCreated = null;
+ EventHandlerBondCreated = (sender, e) => {
+ /* PASS condition for pass_Result_BondCreatedEventArgs_READ_ONLY */
+ Assert.IsTrue((int)e.Result == 0, "BondCreated event is not working properly");
+ pass_Result_BondCreatedEventArgs_READ_ONLY = true;
+
+ /* PASS condition for pass_Device_BondCreatedEventArgs_READ_ONLY */
+ Assert.IsNotNull(e.Device, "BondCreated Device should not be null");
+ pass_Device_BondCreatedEventArgs_READ_ONLY = true;
+
+ /* PASS condition for pass_BondCreated_CHECK_EVENT */
+ pass_BondCreated_CHECK_EVENT = true;
+
+ flagBondCreated = true;
+ bondedDevice = e.Device;
+ };
+ bondedDevice.BondCreated += EventHandlerBondCreated;
+
+ /* PASS condition for pass_CreateBond_RETURN_BOND_CREATED */
+ bondedDevice.CreateBond();
+ await WaitForBondflag();
+ pass_CreateBond_RETURN_BOND_CREATED = true;
+
+ /* Wait for ACL disconnect */
+ await Task.Delay(6000);
+ flagBondCreated = false;
+
+ bondedDevice.BondCreated -= EventHandlerBondCreated;
+ bondedDevice.ConnectionStateChanged -= EventHandlerConnectionStateChanged;
+
+ EventHandler<ServiceSearchedEventArgs> EventHandlerServiceSearched = null;
+ EventHandlerServiceSearched = (sender, e) => {
+ /* PASS condition for pass_Result_ServiceSearchedEventArgs_READ_ONLY */
+ Assert.IsTrue((int)e.Result == 0, "ServiceSearched event is not working properly");
+ pass_Result_ServiceSearchedEventArgs_READ_ONLY = true;
+
+ /* PASS condition for pass_SdpData_ServiceSearchedEventArgs_READ_ONLY */
+ Assert.IsNotNull(e.SdpData, "SdpData should not be null");
+ pass_SdpData_ServiceSearchedEventArgs_READ_ONLY = true;
+
+ /* PASS condition for pass_ServiceSearched_CHECK_EVENT */
+ pass_ServiceSearched_CHECK_EVENT = true;
+
+ /* PASS condition for pass_DeviceAddress_BluetoothDeviceSdpData_PROPERTY_READ_ONLY */
+ Assert.IsNotNull(e.SdpData.DeviceAddress, "SdpData.DeviceAddress should not be null");
+ pass_DeviceAddress_BluetoothDeviceSdpData_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_ServiceUuid_BluetoothDeviceSdpData_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<IEnumerable<string>>(e.SdpData.ServiceUuid, "ServiceUuid value is not of type IEnumerable<string>");
+ pass_ServiceUuid_BluetoothDeviceSdpData_PROPERTY_READ_ONLY = true;
+
+ bondedDevice.ServiceSearched -= EventHandlerServiceSearched;
+ };
+
+ bondedDevice.ServiceSearched += EventHandlerServiceSearched;
+
+ /* PASS condition for pass_StartServiceSearch_RETURN_SERVICE_SEARCH */
+ bondedDevice.StartServiceSearch();
+ pass_StartServiceSearch_RETURN_SERVICE_SEARCH = true;
+
+ await Task.Delay(5000);
+
+ EventHandler<AuthorizationChangedEventArgs> authorizationChangedCallback = null;
+
+ authorizationChangedCallback = (sender, e) => {
+ /* PASS condition for pass_DeviceAddress_BluetoothDeviceSdpData_PROPERTY_READ_ONLY */
+ Assert.IsNotNull(e.DeviceAddress, "Destroyed bond device address should not be null");
+ pass_DeviceAddress_READ_ONLY = true;
+
+ /* PASS condition for pass_Authorization_GET_ENUM_ALL */
+ Assert.IsInstanceOf<BluetoothAuthorizationType>(e.Authorization, "Authorization parameter should be of type BluetoothAuthorizationType");
+ pass_Authorization_GET_ENUM_ALL = true;
+
+ pass_AuthorizationChanged_CHECK_EVENT = true;
+ };
+ bondedDevice.AuthorizationChanged += authorizationChangedCallback;
+
+ /* PASS condition for pass_SetAuthorization_SET_ENUM_ALL */
+ bondedDevice.SetAuthorization(BluetoothAuthorizationType.Authorized);
+ pass_SetAuthorization_SET_ENUM_ALL = true;
+ await Task.Delay(1000);
+
+ bondedDevice.AuthorizationChanged -= authorizationChangedCallback;
+
+ bondedDevice.SetAuthorization(BluetoothAuthorizationType.Unauthorized);
+ await Task.Delay(1000);
+
+ /* PASS condition for pass_GetMaskFromUuid_RETURN_SERVICE_MASK */
+ string[] uuidArr = new String[] { "0000110A-0000-1000-8000-00805F9B34FB",
+ "0000110C-0000-1000-8000-00805F9B34FB",
+ "00001112-0000-1000-8000-00805F9B34FB",
+ "00001800-0000-1000-8000-00805F9B34FB",
+ "00001801-0000-1000-8000-00805F9B34FB",
+ "0000111F-0000-1000-8000-00805F9B34FB",
+ "0000112F-0000-1000-8000-00805F9B34FB",
+ "00001105-0000-1000-8000-00805F9B34FB" };
+
+ BluetoothServiceClassType mask = bondedDevice.GetMaskFromUuid(uuidArr);
+ Assert.IsInstanceOf<BluetoothServiceClassType>(mask);
+ pass_GetMaskFromUuid_RETURN_SERVICE_MASK = true;
+
+ /* PASS condition for pass_Address_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<string>(bondedDevice.Address, "Address value is not of type string");
+ Assert.IsNotNull(bondedDevice.Address, "Address property of remote device is null");
+ pass_Address_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_Name_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<string>(bondedDevice.Name, "Name value is not of type string");
+ Assert.IsNotNull(bondedDevice.Name, "Name property of remote device is null");
+ pass_Name_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_AppearanceType_GET_ENUM_ALL */
+ // Since BluetoothAppearanceType value is coming from capi framework in callback, it is not possible to create test case for all enum values
+ Assert.IsInstanceOf<BluetoothAppearanceType>(bondedDevice.AppearanceType, "AppearanceType is not of type BluetoothAppearanceType");
+ result = Enum.IsDefined(typeof(BluetoothAppearanceType), bondedDevice.AppearanceType);
+ Assert.True(result, "AppearanceType value is not defined in enum");
+ pass_AppearanceType_GET_ENUM_ALL = true;
+
+ /* PASS condition for pass_Rssi_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<int>(bondedDevice.Rssi, "Rssi value is not of type int");
+ pass_Rssi_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_Class_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<BluetoothClass>(bondedDevice.Class, "Should return BluetoothDevice class instance.");
+ pass_Class_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_ServiceUuidList_PROPERTY_READ_ONLY */
+ if (bondedDevice.ServiceCount > 0)
+ {
+ Assert.IsNotNull(bondedDevice.ServiceUuidList, "ServiceUuidList value is null");
+ Assert.IsInstanceOf<Collection<string>>(bondedDevice.ServiceUuidList, "ServiceUuidList value is not of type Collection<string>");
+ }
+ pass_ServiceUuidList_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_ServiceCount_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<int>(bondedDevice.ServiceCount, "ServiceCount value is not of type int");
+ pass_ServiceCount_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_IsPaired_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<bool>(bondedDevice.IsPaired, "IsPaired value is not of type bool");
+ pass_IsPaired_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_ManufacturerDataLength_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<int>(bondedDevice.ManufacturerDataLength, "ManufacturerDataLength value is not of type int");
+ pass_ManufacturerDataLength_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_ManufacturerData_PROPERTY_READ_ONLY */
+ // This check is to bypass the device, which does not have ManufacturerData.
+ if (bondedDevice.ManufacturerData != null)
+ Assert.IsInstanceOf<string>(bondedDevice.ManufacturerData, "ManufacturerData value is not of type string");
+
+ pass_ManufacturerData_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_GetProfile_RETURN_GET_INSTANCE */
+ BluetoothAudio audioObject = bondedDevice.GetProfile<BluetoothAudio>();
+ Assert.IsNotNull(audioObject, "AudioObject should not be null after getting the instance from GetProfile");
+
+ BluetoothAvrcp avrcpObject = bondedDevice.GetProfile<BluetoothAvrcp>();
+ Assert.IsNotNull(avrcpObject, "AvrcpObject should not be null after getting the instance from GetProfile");
+
+ BluetoothHid hidObject = bondedDevice.GetProfile<BluetoothHid>();
+ Assert.IsNotNull(hidObject, "HidObject should not be null after getting the instance from GetProfile");
+
+ pass_GetProfile_RETURN_GET_INSTANCE = true;
+
+ /* PASS condition for pass_SetAlias_RETURN_ALIAS_PAIRED_DEVICE */
+ string _aliasName = "DeviceTctTest";
+
+ bondedDevice.SetAlias(_aliasName);
+ pass_SetAlias_RETURN_ALIAS_PAIRED_DEVICE = true;
+
+ /* PASS condition for pass_GetConnectedProfiles_RETURN_VALUE_PROFILES */
+ IEnumerable<BluetoothProfileType> list = bondedDevice.GetConnectedProfiles();
+ if (!list.Any())
+ {
+ // The actual connected profile information is not related with TC result.
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "No profiles are found.");
+ }
+ else
+ {
+ foreach (BluetoothProfileType item in list)
+ {
+ Assert.IsInstanceOf<BluetoothProfileType>(item, "item value is not of type BluetoothProfileType");
+ }
+ }
+ pass_GetConnectedProfiles_RETURN_VALUE_PROFILES = true;
+
+ /* PASS condition for pass_IsProfileConnected_RETURN_VALUE_CONNECTED */
+ Assert.IsInstanceOf<bool>(bondedDevice.IsProfileConnected(0), "IsProfileConnected value is not of type bool"); // 0: Rfcomm
+ pass_IsProfileConnected_RETURN_VALUE_CONNECTED = true;
+
+ /* PASS condition for pass_IsConnected_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<bool>(bondedDevice.IsConnected, "IsConnected value is not of type bool");
+ pass_IsConnected_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_IsAuthorized_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<bool>(bondedDevice.IsAuthorized, "IsAuthorized value is not of type bool");
+ pass_IsAuthorized_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_MajorDeviceClassType_GET_ENUM_ALL */
+ Assert.IsInstanceOf<BluetoothMajorDeviceClassType>(bondedDevice.Class.MajorDeviceClassType, "MajorDeviceClassType value is not of type BluetoothMajorDeviceClassType");
+ result = Enum.IsDefined(typeof(BluetoothMajorDeviceClassType), bondedDevice.Class.MajorDeviceClassType);
+ Assert.True(result, "MajorDeviceClassType value is not defined in enum");
+ pass_MajorDeviceClassType_GET_ENUM_ALL = true;
+
+ /* PASS condition for pass_MajorServiceClassMask_PROPERTY_READ_ONLY */
+ Assert.IsInstanceOf<int>(bondedDevice.Class.MajorServiceClassMask, "MajorServiceClassMask value is not of type int");
+ pass_MajorServiceClassMask_PROPERTY_READ_ONLY = true;
+
+ /* PASS condition for pass_MinorDeviceClassType_GET_ENUM_ALL */
+ Assert.IsInstanceOf<BluetoothMinorDeviceClassType>(bondedDevice.Class.MinorDeviceClassType, "MinorDeviceClassType value is not of type BluetoothMinorDeviceClassType");
+ result = Enum.IsDefined(typeof(BluetoothMinorDeviceClassType), bondedDevice.Class.MinorDeviceClassType);
+ Assert.True(result, "MinorDeviceClassType value is not defined in enum");
+ pass_MinorDeviceClassType_GET_ENUM_ALL = true;
+
+ /* PASS condition for pass_BluetoothProfile_INIT */
+ string HspHsUuid = "00001108-0000-1000-8000-00805F9B34FB";
+ string HfpHsUuid = "0000111E-0000-1000-8000-00805F9B34FB";
+ string A2dpSnkUuid = "0000110B-0000-1000-8000-00805F9B34FB";
+ string HidUuid = "00001124-0000-1000-8000-00805F9B34FB";
+ BluetoothDevice audioDevice = null;
+ BluetoothDevice avrcpDevice = null;
+ BluetoothDevice hidDevice = null;
+ BluetoothAudio audioProfile = null;
+ BluetoothAvrcp avrcpProfile = null;
+ BluetoothHid hidProfile = null;
+
+ // Get the device instance in the paired list
+ IEnumerable<BluetoothDevice> pairedlist = BluetoothAdapter.GetBondedDevices();
+ if (!pairedlist.Any())
+ {
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "There is no bonded device");
+ Assert.True(false, "No bonded device!!");
+ }
+ else
+ {
+ foreach (BluetoothDevice item in pairedlist)
+ {
+ foreach (string s in item.ServiceUuidList)
+ {
+ if (audioDevice == null && (s.Equals(HspHsUuid) || s.Equals(HfpHsUuid)))
+ {
+ audioDevice = item;
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Found audio Device");
+ break;
+ }
+ if (avrcpDevice == null && s.Equals(A2dpSnkUuid))
+ {
+ avrcpDevice = item;
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Found AVRCP Device");
+ break;
+ }
+ if (hidDevice == null &&s.Equals(HidUuid))
+ {
+ hidDevice = item;
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Found HID Device");
+ break;
+ }
+ }
+ }
+ }
+
+ if (audioDevice != null)
+ {
+ audioProfile = audioDevice.GetProfile<BluetoothAudio>();
+ Assert.IsInstanceOf<BluetoothAudio>(audioProfile, "BluetoothProfile_INIT");
+ Assert.IsNotNull(audioProfile, "BluetoothProfile_INIT");
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "audioProfile Success!");
+ }
+
+ if (avrcpDevice != null)
+ {
+ avrcpProfile = avrcpDevice.GetProfile<BluetoothAvrcp>();
+ Assert.IsInstanceOf<BluetoothAvrcp>(avrcpProfile, "BluetoothProfile_INIT");
+ Assert.IsNotNull(avrcpProfile, "BluetoothProfile_INIT");
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "avrcpProfile Success!");
+ }
+
+ if (hidDevice != null)
+ {
+ hidProfile = hidDevice.GetProfile<BluetoothHid>();
+ Assert.IsInstanceOf<BluetoothHid>(hidProfile, "BluetoothProfile_INIT");
+ Assert.IsNotNull(hidProfile, "BluetoothProfile_INIT");
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "hidProfile Success!");
+ }
+ pass_BluetoothProfile_INIT = true;
+
+ /* PASS condition for pass_CreateSocket_RETURN_TYPE */
+ string ServiceUuid = "00001101-0000-1000-8000-00805F9B7777";
+ IBluetoothClientSocket Client = null;
+ Client = bondedDevice.CreateSocket(ServiceUuid);
+ pass_CreateSocket_RETURN_TYPE = true;
+
+ /* PASS condition for pass_CancelBonding_RETURN_CANCEL_BOND */
+ bondedDevice.CreateBond();
+ bondedDevice.CancelBonding();
+ pass_CancelBonding_RETURN_CANCEL_BOND = true;
+ }
+ catch (Exception ex)
+ {
+ Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Create bond with the bluetooth device")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.CreateBond M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task CreateBond_RETURN_BOND_CREATED()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("CreateBond_RETURN_BOND_CREATED");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_CreateBond_RETURN_BOND_CREATED == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_CreateBond_RETURN_BOND_CREATED, "[TestCase][CreateBond_RETURN_BOND_CREATED] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check create bond event with the bluetooth device")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.BondCreated E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task BondCreated_CHECK_EVENT()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("BondCreated_CHECK_EVENT");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_BondCreated_CHECK_EVENT == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_BondCreated_CHECK_EVENT, "[TestCase][BondCreated_CHECK_EVENT] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Result. Check if Result has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BondCreatedEventArgs.Result A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task Result_BondCreatedEventArgs_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("Result_BondCreatedEventArgs_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_Result_BondCreatedEventArgs_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_Result_BondCreatedEventArgs_READ_ONLY, "[TestCase][Result_BondCreatedEventArgs_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Device. Check if Device has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BondCreatedEventArgs.Device A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task Device_BondCreatedEventArgs_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("Device_BondCreatedEventArgs_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_Device_BondCreatedEventArgs_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_Device_BondCreatedEventArgs_READ_ONLY, "[TestCase][Device_BondCreatedEventArgs_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Destroy bond with the device")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.DestroyBond M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task DestroyBond_RETURN_BOND_DESTROYED()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("DestroyBond_RETURN_BOND_DESTROYED");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_DestroyBond_RETURN_BOND_DESTROYED == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_DestroyBond_RETURN_BOND_DESTROYED, "[TestCase][DestroyBond_RETURN_BOND_DESTROYED] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check destroy bond event with the bluetooth device")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.BondDestroyed E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task BondDestroyed_CHECK_EVENT()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("BondDestroyed_CHECK_EVENT");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_BondDestroyed_CHECK_EVENT == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_BondDestroyed_CHECK_EVENT, "[TestCase][BondDestroyed_CHECK_EVENT] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Result. Check if Result has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BondDestroyedEventArgs.Result A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task Result_BondDestroyedEventArgs_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("Result_BondDestroyedEventArgs_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_Result_BondDestroyedEventArgs_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_Result_BondDestroyedEventArgs_READ_ONLY, "[TestCase][Result_BondDestroyedEventArgs_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test DeviceAddress. Check if DeviceAddress has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BondDestroyedEventArgs.DeviceAddress A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task DeviceAddress_BondDestroyedEventArgs_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("DeviceAddress_BondDestroyedEventArgs_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_DeviceAddress_BondDestroyedEventArgs_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_DeviceAddress_BondDestroyedEventArgs_READ_ONLY, "[TestCase][DeviceAddress_BondDestroyedEventArgs_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Cancel the bonding process")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.CancelBonding M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth and keep all the bluetooth discoverable devices near test device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "If the confirm pin popup comes, do not press confirm or cancel button")]
+ [Step(3, "Check if Also Confirm pin popup should get close.")]
+ [Postcondition(1, "NA")]
+ public async Task CancelBonding_RETURN_CANCEL_BOND()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("CancelBonding_RETURN_CANCEL_BOND");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_CancelBonding_RETURN_CANCEL_BOND == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_CancelBonding_RETURN_CANCEL_BOND, "[TestCase][CancelBonding_RETURN_CANCEL_BOND] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Create bond with the bluetooth device")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ConnectionStateChanged M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task ConnectionStateChanged_CHECK_EVENT()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ConnectionStateChanged_CHECK_EVENT");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_ConnectionStateChanged_CHECK_EVENT == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_ConnectionStateChanged_CHECK_EVENT, "[TestCase][ConnectionStateChanged_CHECK_EVENT] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test IsConnected. Check if IsConnected has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.DeviceConnectionStateChangedEventArgs.IsConnected A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task IsConnected_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("IsConnected_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_IsConnected_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_IsConnected_READ_ONLY, "[TestCase][IsConnected_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ConnectionData. Check if ConnectionData has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.DeviceConnectionStateChangedEventArgs.ConnectionData A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task ConnectionData_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ConnectionData_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_ConnectionData_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_ConnectionData_READ_ONLY, "[TestCase][ConnectionData_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Address. Check the Address value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDeviceConnectionData.Address A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task Address_BluetoothDeviceConnectionData_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("Address_BluetoothDeviceConnectionData_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_Address_BluetoothDeviceConnectionData_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_Address_BluetoothDeviceConnectionData_PROPERTY_READ_ONLY, "[TestCase][Address_BluetoothDeviceConnectionData_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test LinkType. Check whether LinkType is readable and writable")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDeviceConnectionData.LinkType A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRE")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task LinkType_BluetoothDeviceConnectionData_GET_ENUM_ALL()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("LinkType_BluetoothDeviceConnectionData_GET_ENUM_ALL");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_LinkType_BluetoothDeviceConnectionData_GET_ENUM_ALL == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_LinkType_BluetoothDeviceConnectionData_GET_ENUM_ALL, "[TestCase][LinkType_BluetoothDeviceConnectionData_GET_ENUM_ALL] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test DisconnectReason. Check whether DisconnectReason is readable and writable")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDeviceConnectionData.DisconnectReason A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRE")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
+ [Postcondition(1, "NA")]
+ public async Task DisconnectReason_BluetoothDeviceConnectionData_GET_ENUM_ALL()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("DisconnectReason_BluetoothDeviceConnectionData_GET_ENUM_ALL");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_DisconnectReason_BluetoothDeviceConnectionData_GET_ENUM_ALL == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_DisconnectReason_BluetoothDeviceConnectionData_GET_ENUM_ALL, "[TestCase][DisconnectReason_BluetoothDeviceConnectionData_GET_ENUM_ALL] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Search for services on the paired device")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.StartServiceSearch M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Open Bluetooth in Settings on test device")]
+ [Precondition(3, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task StartServiceSearch_RETURN_SERVICE_SEARCH()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("StartServiceSearch_RETURN_SERVICE_SEARCH");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_StartServiceSearch_RETURN_SERVICE_SEARCH == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_StartServiceSearch_RETURN_SERVICE_SEARCH, "[TestCase][StartServiceSearch_RETURN_SERVICE_SEARCH] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check the service searched event of paired device")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ServiceSearched E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Open Bluetooth in Settings on test device")]
+ [Precondition(2, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task ServiceSearched_CHECK_EVENT()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ServiceSearched_CHECK_EVENT");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_ServiceSearched_CHECK_EVENT == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_ServiceSearched_CHECK_EVENT, "[TestCase][ServiceSearched_CHECK_EVENT] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test SdpData. Check if SdpData has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.ServiceSearchedEventArgs.SdpData A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Open Bluetooth in Settings on test device")]
+ [Precondition(3, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task SdpData_ServiceSearchedEventArgs_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("SdpData_ServiceSearchedEventArgs_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_SdpData_ServiceSearchedEventArgs_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_SdpData_ServiceSearchedEventArgs_READ_ONLY, "[TestCase][SdpData_ServiceSearchedEventArgs_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Result. Check the Result value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.ServiceSearchedEventArgs.Result A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Open Bluetooth in Settings on test device")]
+ [Precondition(3, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task Result_ServiceSearchedEventArgs_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("Result_ServiceSearchedEventArgs_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_Result_ServiceSearchedEventArgs_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_Result_ServiceSearchedEventArgs_READ_ONLY, "[TestCase][Result_ServiceSearchedEventArgs_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test DeviceAddress. Check the DeviceAddress value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDeviceSdpData.DeviceAddress A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Open Bluetooth in Settings on test device")]
+ [Precondition(3, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task DeviceAddress_BluetoothDeviceSdpData_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("DeviceAddress_BluetoothDeviceSdpData_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_DeviceAddress_BluetoothDeviceSdpData_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_DeviceAddress_BluetoothDeviceSdpData_PROPERTY_READ_ONLY, "[TestCase][DeviceAddress_BluetoothDeviceSdpData_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ServiceUuid. Check whether ServiceUuid is readable and writable")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDeviceSdpData.ServiceUuid A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Open Bluetooth in Settings on test device")]
+ [Precondition(3, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task ServiceUuid_BluetoothDeviceSdpData_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ServiceUuid_BluetoothDeviceSdpData_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_ServiceUuid_BluetoothDeviceSdpData_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_ServiceUuid_BluetoothDeviceSdpData_PROPERTY_READ_ONLY, "[TestCase][ServiceUuid_BluetoothDeviceSdpData_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Set the authorization of paired device")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.SetAuthorization M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MAE")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device to create bond between them")]
+ [Postcondition(1, "NA")]
+ public async Task SetAuthorization_SET_ENUM_ALL()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("SetAuthorization_SET_ENUM_ALL");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_SetAuthorization_SET_ENUM_ALL == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_SetAuthorization_SET_ENUM_ALL, "[TestCase][SetAuthorization_SET_ENUM_ALL] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check the authorization event of paired device")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.AuthorizationChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Open Bluetooth in Settings on test device")]
+ [Precondition(2, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task AuthorizationChanged_CHECK_EVENT()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("AuthorizationChanged_CHECK_EVENT");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_AuthorizationChanged_CHECK_EVENT == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_AuthorizationChanged_CHECK_EVENT, "[TestCase][AuthorizationChanged_CHECK_EVENT] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Authorization. Check if Authorization has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.AuthorizationChangedEventArgs.Authorization A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRE")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device to create bond between them")]
+ [Postcondition(1, "NA")]
+ public async Task Authorization_GET_ENUM_ALL()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("Authorization_GET_ENUM_ALL");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_Authorization_GET_ENUM_ALL == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_Authorization_GET_ENUM_ALL, "[TestCase][Authorization_GET_ENUM_ALL] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test DeviceAddress. Check if DeviceAddress has proper value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.AuthorizationChangedEventArgs.DeviceAddress A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device to create bond between them")]
+ [Postcondition(1, "NA")]
+ public async Task DeviceAddress_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("DeviceAddress_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_DeviceAddress_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_DeviceAddress_READ_ONLY, "[TestCase][DeviceAddress_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Get the service mask")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.GetMaskFromUuid M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task GetMaskFromUuid_RETURN_SERVICE_MASK()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetMaskFromUuid_RETURN_SERVICE_MASK");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_GetMaskFromUuid_RETURN_SERVICE_MASK == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_GetMaskFromUuid_RETURN_SERVICE_MASK, "[TestCase][GetMaskFromUuid_RETURN_SERVICE_MASK] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Address. Check the Address value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.Address A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task Address_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("Address_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_Address_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_Address_PROPERTY_READ_ONLY, "[TestCase][Address_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Name. Check the Name value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.Name A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task Name_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("Name_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_Name_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_Name_PROPERTY_READ_ONLY, "[TestCase][Name_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test AppearanceType. Check the AppearanceType value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.AppearanceType A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRE")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task AppearanceType_GET_ENUM_ALL()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("AppearanceType_GET_ENUM_ALL");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_AppearanceType_GET_ENUM_ALL == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_AppearanceType_GET_ENUM_ALL, "[TestCase][AppearanceType_GET_ENUM_ALL] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Rssi. Check the Rssi value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.Rssi A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task Rssi_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("Rssi_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_Rssi_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_Rssi_PROPERTY_READ_ONLY, "[TestCase][Rssi_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Class. Check the Class value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.Class A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task Class_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("Class_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_Class_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_Class_PROPERTY_READ_ONLY, "[TestCase][Class_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ServiceUuidList. Check the ServiceUuidList value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ServiceUuidList A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task ServiceUuidList_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ServiceUuidList_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_ServiceUuidList_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_ServiceUuidList_PROPERTY_READ_ONLY, "[TestCase][ServiceUuidList_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ServiceCount. Check the ServiceCount value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ServiceCount A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task ServiceCount_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ServiceCount_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_ServiceCount_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_ServiceCount_PROPERTY_READ_ONLY, "[TestCase][ServiceCount_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test IsPaired. Check the IsPaired value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.IsPaired A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task IsPaired_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("IsPaired_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_IsPaired_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_IsPaired_PROPERTY_READ_ONLY, "[TestCase][IsPaired_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ManufacturerDataLength. Check the ManufacturerDataLength value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ManufacturerDataLength A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task ManufacturerDataLength_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ManufacturerDataLength_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_ManufacturerDataLength_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_ManufacturerDataLength_PROPERTY_READ_ONLY, "[TestCase][ManufacturerDataLength_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ManufacturerData. Check the ManufacturerData value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ManufacturerData A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task ManufacturerData_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("ManufacturerData_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_ManufacturerData_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_ManufacturerData_PROPERTY_READ_ONLY, "[TestCase][ManufacturerData_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Get instance of get profile")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.GetProfile<T> M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task GetProfile_RETURN_GET_INSTANCE()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetProfile_RETURN_GET_INSTANCE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_GetProfile_RETURN_GET_INSTANCE == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_GetProfile_RETURN_GET_INSTANCE, "[TestCase][GetProfile_RETURN_GET_INSTANCE] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Set the alias name of paired device")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.SetAlias 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 the bluetooth")]
+ [Precondition(2, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task SetAlias_RETURN_ALIAS_PAIRED_DEVICE()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("SetAlias_RETURN_ALIAS_PAIRED_DEVICE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_SetAlias_RETURN_ALIAS_PAIRED_DEVICE == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_SetAlias_RETURN_ALIAS_PAIRED_DEVICE, "[TestCase][SetAlias_RETURN_ALIAS_PAIRED_DEVICE] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Get the connected profiles")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.GetConnectedProfiles 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 the bluetooth")]
+ [Precondition(2, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Step(2, "Check if log show \"[TestCase][GetConnectedProfiles] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task GetConnectedProfiles_RETURN_VALUE_PROFILES()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("GetConnectedProfiles_RETURN_VALUE_PROFILES");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_GetConnectedProfiles_RETURN_VALUE_PROFILES == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_GetConnectedProfiles_RETURN_VALUE_PROFILES, "[TestCase][GetConnectedProfiles_RETURN_VALUE_PROFILES] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check the profile is connected")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.IsProfileConnected 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 the bluetooth")]
+ [Precondition(2, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task IsProfileConnected_RETURN_VALUE_CONNECTED()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("IsProfileConnected_RETURN_VALUE_CONNECTED");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_IsProfileConnected_RETURN_VALUE_CONNECTED == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_IsProfileConnected_RETURN_VALUE_CONNECTED, "[TestCase][IsProfileConnected_RETURN_VALUE_CONNECTED] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test IsConnected. Check the IsConnected value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.IsConnected A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Open Bluetooth in Settings on test device")]
+ [Precondition(2, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task IsConnected_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("IsConnected_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_IsConnected_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_IsConnected_PROPERTY_READ_ONLY, "[TestCase][IsConnected_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test IsAuthorized. Check the IsAuthorized value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.IsAuthorized A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Open Bluetooth in Settings on test device")]
+ [Precondition(2, "Pair with atleast one nearby bluetooth device")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task IsAuthorized_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("IsAuthorized_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_IsAuthorized_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_IsAuthorized_PROPERTY_READ_ONLY, "[TestCase][IsAuthorized_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test MajorDeviceClassType. Check the MajorDeviceClassType value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothClass.MajorDeviceClassType A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRE")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task MajorDeviceClassType_GET_ENUM_ALL()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("MajorDeviceClassType_GET_ENUM_ALL");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_MajorDeviceClassType_GET_ENUM_ALL == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_MajorDeviceClassType_GET_ENUM_ALL, "[TestCase][MajorDeviceClassType_GET_ENUM_ALL] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test MajorServiceClassMask. Check the MajorServiceClassMask value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothClass.MajorServiceClassMask A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task MajorServiceClassMask_PROPERTY_READ_ONLY()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("MajorServiceClassMask_PROPERTY_READ_ONLY");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_MajorServiceClassMask_PROPERTY_READ_ONLY == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_MajorServiceClassMask_PROPERTY_READ_ONLY, "[TestCase][MajorServiceClassMask_PROPERTY_READ_ONLY] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test MinorDeviceClassType. Check the MinorDeviceClassType value")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothClass.MinorDeviceClassType A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRE")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task MinorDeviceClassType_GET_ENUM_ALL()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("MinorDeviceClassType_GET_ENUM_ALL");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_MinorDeviceClassType_GET_ENUM_ALL == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_MinorDeviceClassType_GET_ENUM_ALL, "[TestCase][MinorDeviceClassType_GET_ENUM_ALL] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Get the BluetoothProfile instance from abstract class")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothProfile.BluetoothProfile M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Paired with the remote device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task BluetoothProfile_INIT()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("BluetoothProfile_INIT");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_BluetoothProfile_INIT == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_BluetoothProfile_INIT, "[TestCase][BluetoothProfile_INIT] Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Return type of CreateSocket.")]
+ [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.CreateSocket M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Adhavan, adhavan.m@samsung.com")]
+ [Precondition(1, "Turn on the bluetooth")]
+ [Precondition(2, "Run this only on test device which acts as client")]
+ [Precondition(3, "Keep all the bluetooth discoverable devices near the test device.")]
+ [Step(1, "Tap the Run button")]
+ [Postcondition(1, "NA")]
+ public async Task CreateSocket_RETURN_TYPE()
+ {
+ /* We can't occupy the precondition, if Bluetooth feature is not supported in Manual TC */
+ if (isBluetoothSupported == false)
+ {
+ BluetoothHelper.DisplayLabel("CreateSocket_RETURN_TYPE");
+ await ManualTest.WaitForConfirm();
+ return;
+ }
+
+ if (pass_CreateSocket_RETURN_TYPE == false)
+ await DeviceCombine_TEST();
+
+ Assert.True(pass_CreateSocket_RETURN_TYPE, "[TestCase][CreateSocket_RETURN_TYPE] Fail");
+ }
+ }
+}
+++ /dev/null
-using System;
-using System.Threading.Tasks;
-using System.Linq;
-using System.Collections.Generic;
-using BluetoothNetworkUtils;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Collections.ObjectModel;
-using Tizen.System;
-using Xamarin.Forms;
-
-namespace Tizen.Network.Bluetooth.Tests
-{
- [TestFixture]
- [Description("BluetoothDevice Tests")]
- public class BluetoothDeviceTests
- {
- static bool flagDiscovery = false;
- static bool flagBondCreated = false;
- static BluetoothDevice device = null;
- static BluetoothDevice bondedDevice = null;
- static bool isBluetoothSupported = false;
- static bool isBluetoothLeSupported = false;
- public static string remote_addr = PreconditionUtils.GetBtAddress();
- public static string default_remote_addr = PreconditionUtils.GetDefaultAddress();
-
- [SetUp]
- public static void Init()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST");
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out isBluetoothSupported);
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth.le", out isBluetoothLeSupported);
- flagDiscovery = false;
- }
- [TearDown]
- public static void Destroy()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST");
- }
-
- public static void Setup()
- {
- bondedDevice = BluetoothAdapter.GetBondedDevice(remote_addr);
- }
-
- public static async Task DiscoverySetup()
- {
- BluetoothAdapter.DiscoveryStateChanged += EventHandlerDiscoveryChanged;
- BluetoothAdapter.StartDiscovery();
- await WaitForDiscoveryflag();
- BluetoothAdapter.StopDiscovery();
- await Task.Delay(8000);
- BluetoothAdapter.DiscoveryStateChanged -= EventHandlerDiscoveryChanged;
- }
-
- public static async Task WaitForBondflag()
- {
- int count = 0;
- while(true)
- {
- await Task.Delay(1000);
- count++;
- if (flagBondCreated)
- break;
- if (count == 9)
- break;
- }
- }
-
- public static async Task WaitForDiscoveryflag()
- {
- int count = 0;
- while(true)
- {
- await Task.Delay(1000);
- count++;
- if (flagDiscovery)
- break;
- if (count == 8)
- break;
- }
- }
-
- public static void EventHandlerDiscoveryChanged(object sender, DiscoveryStateChangedEventArgs e)
- {
- if (e.DiscoveryState == BluetoothDeviceDiscoveryState.Found)
- {
- if (flagDiscovery == true)
- return;
-
- if (remote_addr.Equals(default_remote_addr))
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Use the first found device");
- }
- else if (e.DeviceFound.Address.Equals(remote_addr))
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Found the matching device: " + e.DeviceFound.Address);
- }
- else
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Exception: " + e.DeviceFound.Address);
- return;
- }
-
- device = e.DeviceFound;
- flagDiscovery = true;
- }
- }
-
- public static void EventHandlerBondCreated(object sender, BondCreatedEventArgs e)
- {
- if (e.Device != null && e.Result == 0)
- {
- flagBondCreated = true;
- ManualTest.Confirm ();
- bondedDevice = e.Device;
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Get the service mask")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.GetMaskFromUuid M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task GetMaskFromUuid_RETURN_SERVICE_MASK()
- {
- try
- {
- string[] uuidArr = new String[] { "0000110A-0000-1000-8000-00805F9B34FB",
- "0000110C-0000-1000-8000-00805F9B34FB",
- "00001112-0000-1000-8000-00805F9B34FB",
- "00001800-0000-1000-8000-00805F9B34FB",
- "00001801-0000-1000-8000-00805F9B34FB",
- "0000111F-0000-1000-8000-00805F9B34FB",
- "0000112F-0000-1000-8000-00805F9B34FB",
- "00001105-0000-1000-8000-00805F9B34FB" };
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
- // TEST CODE
- BluetoothServiceClassType mask = device.GetMaskFromUuid(uuidArr);
- Assert.IsInstanceOf<BluetoothServiceClassType>(mask);
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("GetMaskFromUuid_RETURN_SERVICE_MASK");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("GetMaskFromUuid_RETURN_SERVICE_MASK");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Address. Check the Address value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.Address A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task Address_PROPERTY_READ_ONLY()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
- // TEST CODE
- Assert.IsInstanceOf<string>(device.Address, "Address value is not of type string");
- Assert.IsNotNull(device.Address, "Address property of remote device is null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("Address_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("Address_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Name. Check the Name value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.Name A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task Name_PROPERTY_READ_ONLY()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
-
- // TEST CODE
- Assert.IsInstanceOf<string>(device.Name, "Name value is not of type string");
- Assert.IsNotNull(device.Name, "Name property of remote device is null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("Name_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("Name_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test AppearanceType. Check the AppearanceType value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.AppearanceType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task AppearanceType_GET_ENUM_ALL()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
-
- // TEST CODE
- Assert.IsInstanceOf<BluetoothAppearanceType>(device.AppearanceType, "AppearanceType is not of type BluetoothAppearanceType");
- Assert.IsNotNull(device.AppearanceType, "device.AppearanceType is null");
- bool result = Enum.IsDefined(typeof(BluetoothAppearanceType), device.AppearanceType);
- Assert.True(result, "AppearanceType value is not defined in enum");
-
- // Since BluetoothAppearanceType value is coming from capi framework in callback, it is not possible to create test case for all enum values
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("AppearanceType_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("AppearanceType_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Rssi. Check the Rssi value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.Rssi A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task Rssi_PROPERTY_READ_ONLY()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
- // TEST CODE
- Assert.IsInstanceOf<int>(device.Rssi, "Rssi value is not of type int");
- Assert.IsNotNull(device.Rssi, "Rssi property of remote device is null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("Rssi_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("Rssi_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Class. Check the Class value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.Class A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task Class_PROPERTY_READ_ONLY()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
- /* TEST CODE */
- Assert.IsInstanceOf<BluetoothClass>(device.Class, "Should return BluetoothDevice class instance.");
- Assert.IsNotNull(device.Class, "Class property should not be null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("Rssi_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("Rssi_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test ServiceUuidList. Check the ServiceUuidList value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ServiceUuidList A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task ServiceUuidList_PROPERTY_READ_ONLY()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
-
- // TEST CODE
- Log.Debug("TCT", "add = " + device.Address);
-
- if (device.ServiceCount > 0)
- {
- Assert.IsNotNull(device.ServiceUuidList, "ServiceUuidList value is null");
- Assert.IsInstanceOf<Collection<string>>(device.ServiceUuidList, "ServiceUuidList value is not of type Collection<string>");
- }
- else
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Service count is 0, so can't check the service list: PASS");
- }
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("ServiceUuidList_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("ServiceUuidList_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test ServiceCount. Check the ServiceCount value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ServiceCount A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task ServiceCount_PROPERTY_READ_ONLY()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
-
- // TEST CODE
- Assert.IsInstanceOf<int>(device.ServiceCount, "ServiceCount value is not of type int");
- Assert.IsNotNull(device.ServiceCount, "ServiceCount property of remote device is null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("ServiceCount_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("ServiceCount_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IsPaired. Check the IsPaired value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.IsPaired A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task IsPaired_PROPERTY_READ_ONLY()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
-
- // TEST CODE
- Assert.IsInstanceOf<bool>(device.IsPaired, "IsPaired value is not of type bool");
- Assert.IsNotNull(device.IsPaired, "Paired property of remote device is null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("IsPaired_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("IsPaired_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test ManufacturerDataLength. Check the ManufacturerDataLength value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ManufacturerDataLength A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task ManufacturerDataLength_PROPERTY_READ_ONLY()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
-
- // TEST CODE
- Assert.IsInstanceOf<int>(device.ManufacturerDataLength, "ManufacturerDataLength value is not of type int");
- Assert.IsNotNull(device.ManufacturerDataLength, "ManufacturerDataLength property of remote device is null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("ManufacturerDataLength_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("ManufacturerDataLength_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test ManufacturerData. Check the ManufacturerData value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ManufacturerData A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task ManufacturerData_PROPERTY_READ_ONLY()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
-
- // TEST CODE
- // This check is to bypass the device, which does not have ManufacturerData.
- if (device.ManufacturerData != null)
- {
- Assert.IsInstanceOf<string>(device.ManufacturerData, "ManufacturerData value is not of type string");
- }
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("ManufacturerData_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("ManufacturerData_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Get instance of get profile")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.GetProfile<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task GetProfile_RETURN_GET_INSTANCE()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
-
- // TEST CODE
-
- // Test for Audio Object
- BluetoothAudio audioObject = device.GetProfile<BluetoothAudio>();
- Assert.IsNotNull(audioObject, "AudioObject should not be null after getting the instance from GetProfile");
-
- // Test for Avrcp Object
- BluetoothAvrcp avrcpObject = device.GetProfile<BluetoothAvrcp>();
- Assert.IsNotNull(avrcpObject, "AvrcpObject should not be null after getting the instance from GetProfile");
-
- // Test for Audio Object
- BluetoothHid hidObject = device.GetProfile<BluetoothHid>();
- Assert.IsNotNull(hidObject, "HidObject should not be null after getting the instance from GetProfile");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("GetProfile_RETURN_GET_INSTANCE");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("GetProfile_RETURN_GET_INSTANCE");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Create bond with the bluetooth device")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.CreateBond M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task CreateBond_RETURN_BOND_CREATED()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup ();
- Assert.IsNotNull (device, "DeviceFound during discovery should not be null");
- }
-
- device.BondCreated += EventHandlerBondCreated;
- device.CreateBond();
- await ManualTest.WaitForConfirm();
-
- device.BondCreated -= EventHandlerBondCreated;
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("CreateBond_RETURN_BOND_CREATED");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("CreateBond_RETURN_BOND_CREATED");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- public static void EventHandlerBondDestroyed(object sender, BondDestroyedEventArgs e)
- {
- Assert.IsNotNull(e.DeviceAddress, "Destroyed bond device address should not be null");
- Assert.IsTrue((int)e.Result == 0, "BondDestroyed event is not working properly");
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Destroy bond with the device")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.DestroyBond M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task DestroyBond_RETURN_BOND_DESTROYED()
- {
- try
- {
- bondedDevice = BluetoothAdapter.GetBondedDevice(remote_addr);
-
- if (bondedDevice == null)
- {
- await DiscoverySetup ();
- Assert.IsNotNull (device, "found device should not be null");
-
- if (device.IsPaired == false)
- {
- device.BondCreated += EventHandlerBondCreated;
- device.CreateBond();
- await WaitForBondflag();
- device.BondCreated -= EventHandlerBondCreated;
- }
- else
- {
- bondedDevice = device;
- }
- }
-
- Assert.IsNotNull (bondedDevice, "Bonded device should not be null");
-
- bondedDevice.BondDestroyed += EventHandlerBondDestroyed;
- bondedDevice.DestroyBond();
- await ManualTest.WaitForConfirm();
-
- bondedDevice.BondDestroyed -= EventHandlerBondDestroyed;
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("DestroyBond_RETURN_BOND_DESTROYED");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("DestroyBond_RETURN_BOND_DESTROYED");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Cancel the bonding process")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.CancelBonding M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth and keep all the bluetooth discoverable devices near test device")]
- [Step(1, "Tap the Run button")]
- [Step(2, "If the confirm pin popup comes, do not press confirm or cancel button")]
- [Step(3, "Check if Also Confirm pin popup should get close.")]
- [Postcondition(1, "NA")]
- public static async Task CancelBonding_RETURN_CANCEL_BOND()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- }
-
- device.CreateBond();
-
- device.CancelBonding();
-
- BluetoothHelper.DisplayPassLabel("CancelBonding_RETURN_CANCEL_BOND");
- await ManualTest.WaitForConfirm();
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("CancelBonding_RETURN_CANCEL_BOND");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("CancelBonding_RETURN_CANCEL_BOND");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check create bond event with the bluetooth device")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.BondCreated E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task BondCreated_CHECK_EVENT()
- {
- try
- {
- if (device == null)
- {
- await DiscoverySetup ();
- Assert.IsNotNull (device, "DeviceFound during discovery should not be null");
- }
-
- device.BondCreated += EventHandlerBondCreated;
- device.CreateBond();
-
- await ManualTest.WaitForConfirm();
-
- device.BondCreated -= EventHandlerBondCreated;
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("BondCreated_CHECK_EVENT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("BondCreated_CHECK_EVENT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check destroy bond event with the bluetooth device")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.BondDestroyed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task BondDestroyed_CHECK_EVENT()
- {
- try
- {
- bondedDevice = BluetoothAdapter.GetBondedDevice(remote_addr);
-
- if (bondedDevice == null)
- {
- await DiscoverySetup ();
- Assert.IsNotNull (device, "found device should not be null");
-
- if (device.IsPaired == false)
- {
- device.BondCreated += EventHandlerBondCreated;
- device.CreateBond();
- await WaitForBondflag();
- device.BondCreated -= EventHandlerBondCreated;
- }
- else
- {
- bondedDevice = device;
- }
- }
-
- Assert.IsNotNull (bondedDevice, "Bonded device should not be null");
-
- bondedDevice.BondDestroyed += EventHandlerBondDestroyed;
- bondedDevice.DestroyBond();
- await ManualTest.WaitForConfirm();
-
- bondedDevice.BondDestroyed -= EventHandlerBondDestroyed;
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("BondDestroyed_CHECK_EVENT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("BondDestroyed_CHECK_EVENT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Set the alias name of paired device")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.SetAlias 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 the bluetooth")]
- [Precondition(2, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static void SetAlias_RETURN_ALIAS_PAIRED_DEVICE()
- {
- try
- {
- string _aliasName = "DeviceTctTest";
-
- Setup();
-
- Assert.IsNotNull(bondedDevice, "Bonded device should not be null");
-
- bondedDevice.SetAlias(_aliasName);
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("SetAlias_RETURN_ALIAS_PAIRED_DEVICE");
- ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("SetAlias_RETURN_ALIAS_PAIRED_DEVICE");
- ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- public static async Task SetupAuthorizationTest(BluetoothAuthorizationType value)
- {
- EventHandler<AuthorizationChangedEventArgs> authorizationChangedCallback = null;
-
- // TEST CODE
- authorizationChangedCallback = (sender, e) => {
- if (e.Authorization == value && e.DeviceAddress != null)
- {
- ManualTest.Confirm();
- }
- };
- bondedDevice.AuthorizationChanged += authorizationChangedCallback;
- bondedDevice.SetAuthorization(value);
- await ManualTest.WaitForConfirm();
-
- // POSTCONDITION
- bondedDevice.AuthorizationChanged -= authorizationChangedCallback;
- }
-
- [Test]
- [Category("P1")]
- [Description("Set the authorization of paired device")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.SetAuthorization M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MAE")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device")]
- [Step(1, "Tap the Run button")]
- [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device to create bond between them")]
- [Postcondition(1, "NA")]
- public static async Task SetAuthorization_SET_ENUM_ALL()
- {
- try
- {
- bondedDevice = BluetoothAdapter.GetBondedDevice(remote_addr);
-
- if (bondedDevice == null)
- {
- await DiscoverySetup ();
- Assert.IsNotNull (device, "Bonded device should not be null");
-
- if (device.IsPaired == false)
- {
- device.BondCreated += EventHandlerBondCreated;
- device.CreateBond();
- await WaitForBondflag();
- device.BondCreated -= EventHandlerBondCreated;
- }
- else
- {
- bondedDevice = device;
- }
- }
-
- if (bondedDevice.IsAuthorized == true)
- {
- bondedDevice.SetAuthorization(BluetoothAuthorizationType.Unauthorized);
- await Task.Delay(200);
- }
-
- // Test with enum value : BluetoothAuthorizationType.Authorized
- bondedDevice.SetAuthorization(BluetoothAuthorizationType.Authorized);
-
- bondedDevice.SetAuthorization(BluetoothAuthorizationType.Unauthorized);
-
- ManualTest.Confirm();
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("SetAuthorization_SET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("SetAuthorization_SET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- public static void EventHandlerServiceSearched(object sender, ServiceSearchedEventArgs e)
- {
- Assert.IsNotNull(e.SdpData.DeviceAddress, "SdpData.DeviceAddress should not be null");
- Assert.IsTrue((int)e.Result == 0, "ServiceSearched event is not working properly");
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Search for services on the paired device")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.StartServiceSearch M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Open Bluetooth in Settings on test device")]
- [Precondition(3, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task StartServiceSearch_RETURN_SERVICE_SEARCH()
- {
- try
- {
- Setup();
- Assert.IsNotNull(bondedDevice, "Bonded device should not be null");
-
- bondedDevice.ServiceSearched += EventHandlerServiceSearched;
- bondedDevice.StartServiceSearch();
- await ManualTest.WaitForConfirm();
-
- bondedDevice.ServiceSearched -= EventHandlerServiceSearched;
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("StartServiceSearch_RETURN_SERVICE_SEARCH");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("StartServiceSearch_RETURN_SERVICE_SEARCH");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Get the connected profiles")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.GetConnectedProfiles 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 the bluetooth")]
- [Precondition(2, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Step(2, "Check if log show \"[TestCase][GetConnectedProfiles] Pass\".")]
- [Postcondition(1, "Close the terminal")]
- public static async Task GetConnectedProfiles_RETURN_VALUE_PROFILES()
- {
- try
- {
- Setup();
- Assert.IsNotNull(bondedDevice, "Bonded device should not be null");
-
- IEnumerable<BluetoothProfileType> list = bondedDevice.GetConnectedProfiles();
- if (!list.Any())
- {
- // The actual connected profile information is not related with TC result.
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "No profiles are found.");
- }
- else
- {
- foreach (BluetoothProfileType item in list)
- {
- if(!item.Equals(null) && BluetoothProfileType.IsDefined(typeof(BluetoothProfileType), item))
- ManualTest.Confirm();
- }
- }
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("GetConnectedProfiles_RETURN_VALUE_PROFILES");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("GetConnectedProfiles_RETURN_VALUE_PROFILES");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the profile is connected")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.IsProfileConnected 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 the bluetooth")]
- [Precondition(2, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static void IsProfileConnected_RETURN_VALUE_CONNECTED()
- {
- try
- {
- Setup();
- Assert.IsNotNull(bondedDevice, "Bonded device should not be null");
-
- // TEST CODE
- bool isConnected = bondedDevice.IsProfileConnected(0); // 0: Rfcomm
-
- // The actual connected status is not related with TC result
- //Assert.IsTrue(isConnected, "[TestCase][IsProfileConnected], not connected, Failed");
- if (isConnected)
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "rfcomm is connected");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("IsProfileConnected_RETURN_VALUE_CONNECTED");
- ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("IsProfileConnected_RETURN_VALUE_CONNECTED");
- ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- public static void EventHandlerConnectionStateChanged(object sender, DeviceConnectionStateChangedEventArgs e)
- {
- Assert.True(e.IsConnected, "Device should be connected");
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Create bond with the bluetooth device")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ConnectionStateChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task ConnectionStateChanged_CHECK_EVENT()
- {
- try
- {
- await DiscoverySetup();
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
-
- device.ConnectionStateChanged += EventHandlerConnectionStateChanged;
- device.CreateBond();
- await ManualTest.WaitForConfirm();
-
- device.ConnectionStateChanged -= EventHandlerConnectionStateChanged;
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("ConnectionStateChanged_CHECK_EVENT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("ConnectionStateChanged_CHECK_EVENT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the authorization event of paired device")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.AuthorizationChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Open Bluetooth in Settings on test device")]
- [Precondition(2, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task AuthorizationChanged_CHECK_EVENT()
- {
- try
- {
- bondedDevice = BluetoothAdapter.GetBondedDevice(remote_addr);
-
- if (bondedDevice == null)
- {
- await DiscoverySetup ();
- Assert.IsNotNull (device, "Bonded device should not be null");
-
- if (device.IsPaired == false)
- {
- device.BondCreated += EventHandlerBondCreated;
- device.CreateBond();
- await WaitForBondflag();
- device.BondCreated -= EventHandlerBondCreated;
- }
- else
- {
- bondedDevice = device;
- }
- }
-
- if (bondedDevice.IsAuthorized == true)
- {
- bondedDevice.SetAuthorization(BluetoothAuthorizationType.Unauthorized);
- await Task.Delay(200);
- }
-
- // Test with enum value : BluetoothAuthorizationType.Authorized
- await SetupAuthorizationTest(BluetoothAuthorizationType.Authorized);
-
- // Test with enum value : BluetoothAuthorizationType.Unauthorized
- await SetupAuthorizationTest(BluetoothAuthorizationType.Unauthorized);
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("AuthorizationChanged_CHECK_EVENT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("AuthorizationChanged_CHECK_EVENT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the service searched event of paired device")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.ServiceSearched E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Open Bluetooth in Settings on test device")]
- [Precondition(2, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task ServiceSearched_CHECK_EVENT()
- {
- try
- {
- Setup();
- Assert.IsNotNull(bondedDevice, "Bonded device should not be null");
-
- bondedDevice.ServiceSearched += EventHandlerServiceSearched;
- bondedDevice.StartServiceSearch();
- await ManualTest.WaitForConfirm();
-
- // POSTCONDITION
- bondedDevice.ServiceSearched -= EventHandlerServiceSearched;
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("ServiceSearched_CHECK_EVENT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("ServiceSearched_CHECK_EVENT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- public static void DiscoveryChangedEventHandler(object sender, DiscoveryStateChangedEventArgs args)
- {
- Log.Info(Globals.LogTag, "DiscoverySateChanged callback "+ args.DiscoveryState);
- if (args.DiscoveryState == BluetoothDeviceDiscoveryState.Found)
- {
- if (remote_addr.Equals(default_remote_addr))
- {
- if (BluetoothSetup.Client != null)
- return;
-
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Use the first found device");
- }
- else if (args.DeviceFound.Address.Equals(remote_addr))
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Found the matching device: " + args.DeviceFound.Address);
- }
- else
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Exception: " + args.DeviceFound.Address);
- return;
- }
-
- Log.Info(Globals.LogTag, "DiscoverySateChanged callback device found: "+ args.DeviceFound.Name);
- BluetoothSetup.Client = args.DeviceFound.CreateSocket(BluetoothSetup.ServiceUuid);
- ManualTest.Confirm();
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Return type of CreateSocket.")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.CreateSocket M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Adhavan, adhavan.m@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Run this only on test device which acts as client")]
- [Precondition(3, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task CreateSocket_RETURN_TYPE()
- {
- try
- {
- BluetoothAdapter.DiscoveryStateChanged += DiscoveryChangedEventHandler;
- BluetoothAdapter.StartDiscovery();
- await ManualTest.WaitForConfirm();
-
- if (BluetoothAdapter.IsDiscoveryInProgress)
- BluetoothAdapter.StopDiscovery();
-
- BluetoothAdapter.DiscoveryStateChanged -= DiscoveryChangedEventHandler;
- Assert.IsNotNull(BluetoothSetup.Client, "IBluetoothClientSocket is null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("CreateSocket_RETURN_TYPE");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("CreateSocket_RETURN_TYPE");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IsConnected. Check the IsConnected value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.IsConnected A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Open Bluetooth in Settings on test device")]
- [Precondition(2, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static void IsConnected_PROPERTY_READ_ONLY()
- {
- try
- {
- if (bondedDevice == null)
- {
- Setup();
- Assert.IsNotNull(bondedDevice, "Bonded device should not be null");
- }
-
- // TEST CODE
- Assert.IsInstanceOf<bool>(bondedDevice.IsConnected, "IsConnected value is not of type bool");
- Assert.IsNotNull(bondedDevice.IsConnected, "IsConnected property of remote device is null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("IsConnected_PROPERTY_READ_ONLY");
- ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("IsConnected_PROPERTY_READ_ONLY");
- ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IsAuthorized. Check the IsAuthorized value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDevice.IsAuthorized A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Open Bluetooth in Settings on test device")]
- [Precondition(2, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static void IsAuthorized_PROPERTY_READ_ONLY()
- {
- try
- {
- if (bondedDevice == null)
- {
- Setup();
- Assert.IsNotNull(bondedDevice, "Bonded device should not be null");
- }
-
- // TEST CODE
- Assert.IsInstanceOf<bool>(bondedDevice.IsAuthorized, "IsAuthorized value is not of type bool");
- Assert.IsNotNull(bondedDevice.IsAuthorized, "IsAuthorized property of remote device is null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("IsAuthorized_PROPERTY_READ_ONLY");
- ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("IsAuthorized_PROPERTY_READ_ONLY");
- ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-using System;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.System;
-using Xamarin.Forms;
-
-namespace Tizen.Network.Bluetooth.Tests
-{
- [TestFixture]
- [Description("BluetoothDeviceConnectionData Tests")]
- public class BluetoothDeviceConnectionDataTests
- {
- static bool flagDiscovery = false;
- static bool flagDiscoveryFinished = false;
- static BluetoothDevice device = null;
- static BluetoothDeviceConnectionData connectionData = null;
- static bool isBluetoothSupported = false;
- static bool isBluetoothLeSupported = false;
-
- [SetUp]
- public static void Init()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST");
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out isBluetoothSupported);
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth.le", out isBluetoothLeSupported);
- }
- [TearDown]
- public static void Destroy()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST");
- }
-
- public static void EventHandlerDeviceDiscoveryChanged(object sender, DiscoveryStateChangedEventArgs e)
- {
- if (e.DiscoveryState == BluetoothDeviceDiscoveryState.Found)
- {
- device = e.DeviceFound;
- flagDiscovery = true;
- }
- if (e.DiscoveryState == BluetoothDeviceDiscoveryState.Finished)
- flagDiscoveryFinished = true;
- }
-
- public static void EventHandlerConnectionStateChanged(object sender, DeviceConnectionStateChangedEventArgs e)
- {
- Assert.IsNotNull(e.ConnectionData, "ConnectionData value is null");
- connectionData = e.ConnectionData;
- }
-
- public static async Task DiscoverySetup()
- {
- if(device == null)
- {
- /* PRECONDITION
- * 1. Register event handler
- */
- BluetoothAdapter.DiscoveryStateChanged += EventHandlerDeviceDiscoveryChanged;
-
- /* TEST CODE */
- BluetoothAdapter.StartDiscovery();
- await WaitDiscoveryFlag();
- BluetoothAdapter.StopDiscovery();
- await WaitFinishedFlag();
-
- /* POSTCONDITION
- * 1. Unregister event handler
- */
- BluetoothAdapter.DiscoveryStateChanged -= EventHandlerDeviceDiscoveryChanged;
- }
- Assert.IsNotNull(device, "DeviceFound during discovery should not be null");
- if(connectionData == null)
- {
- device.ConnectionStateChanged += EventHandlerConnectionStateChanged;
- device.CreateBond();
- await Task.Delay(9000);
- device.ConnectionStateChanged -= EventHandlerConnectionStateChanged;
- }
- }
-
- public static async Task WaitDiscoveryFlag()
- {
- int count = 0;
- while(true)
- {
- await Task.Delay(2000);
- count++;
- if (flagDiscovery)
- break;
- if (count == 3)
- break;
- }
- }
-
- public static async Task WaitFinishedFlag()
- {
- int count = 0;
- while(true)
- {
- await Task.Delay(1000);
- count++;
- if (flagDiscoveryFinished)
- break;
- if (count == 8)
- break;
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Address. Check the Address value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDeviceConnectionData.Address A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task Address_PROPERTY_READ_ONLY()
- {
- try
- {
- await DiscoverySetup();
-
- // TEST CODE
- Assert.IsInstanceOf<string>(connectionData.Address, "Address value is not of type string");
- Assert.IsNotNull(connectionData.Address, "Address value is null");
- Assert.AreEqual(device.Address, connectionData.Address, "Address property of device is not equal to remote device address");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("Address_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("Address_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test LinkType. Check whether LinkType is readable and writable")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDeviceConnectionData.LinkType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task LinkType_GET_ENUM_ALL()
- {
- try
- {
- await DiscoverySetup();
-
- Assert.IsInstanceOf<BluetoothConnectionLinkType>(connectionData.LinkType, "LinkType value is not of type BluetoothConnectionLinkType");
- Assert.IsNotNull(connectionData.LinkType, "connectionData.LinkType is null");
- bool result = Enum.IsDefined(typeof(BluetoothConnectionLinkType), connectionData.LinkType);
- Assert.IsTrue(result, "LinkType value is not defined in BluetoothConnectionLinkType enum");
-
- // Since BluetoothConnectionLinkType value is coming from capi framework in callback, it is not possible to create test case for all enum values
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("LinkType_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("LinkType_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test DisconnectReason. Check whether DisconnectReason is readable and writable")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDeviceConnectionData.DisconnectReason A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task DisconnectReason_GET_ENUM_ALL()
- {
- try
- {
- await DiscoverySetup();
-
- Assert.IsInstanceOf<BluetoothDisconnectReason>(connectionData.DisconnectReason, "DisconnectReason is not of type BluetoothDisconnectReason");
- Assert.IsNotNull(connectionData.DisconnectReason, "connectionData.DisconnectReason is null");
- bool result = Enum.IsDefined(typeof(BluetoothDisconnectReason), connectionData.DisconnectReason);
- Assert.IsTrue(result, "DisconnectReason value is not defined in BluetoothDisconnectReason enum");
-
- // Since BluetoothDisconnectReason value is coming from capi framework in callback, it is not possible to create test case for all enum values
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("DisconnectReason_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("DisconnectReason_GET_ENUM_ALL");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-using System.Collections.ObjectModel;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using BluetoothNetworkUtils;
-using Tizen.System;
-using Xamarin.Forms;
-using System;
-
-namespace Tizen.Network.Bluetooth.Tests
-{
- [TestFixture]
- [Description("BluetoothDeviceSdpData Tests")]
- public class BluetoothDeviceSdpDataTests
- {
- static BluetoothDevice bondedDevice = null;
- static BluetoothDeviceSdpData sdpData = null;
- static bool isBluetoothSupported = false;
- static bool isBluetoothLeSupported = false;
- public static string remote_addr = PreconditionUtils.GetBtAddress();
-
- [SetUp]
- public static void Init()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST");
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out isBluetoothSupported);
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth.le", out isBluetoothLeSupported);
- }
- [TearDown]
- public static void Destroy()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST");
- }
-
- public static void EventHandlerServiceSearched(object sender, ServiceSearchedEventArgs e)
- {
- Assert.IsNotNull(e.SdpData, "SdpData instance should not be null");
- sdpData = e.SdpData;
- }
-
- public static async Task Setup()
- {
- // PRECONDITION
- if (bondedDevice == null)
- {
- bondedDevice = BluetoothAdapter.GetBondedDevice(remote_addr);
- Assert.IsNotNull(bondedDevice, "Bonded device should not be null");
- }
- if (sdpData == null)
- {
- // TEST CODE
- bondedDevice.ServiceSearched += EventHandlerServiceSearched;
- bondedDevice.StartServiceSearch();
- await Task.Delay(9000);
-
- // POSTCONDITION
- bondedDevice.ServiceSearched -= EventHandlerServiceSearched;
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test DeviceAddress. Check the DeviceAddress value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDeviceSdpData.DeviceAddress A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Open Bluetooth in Settings on test device")]
- [Precondition(3, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task DeviceAddress_PROPERTY_READ_ONLY()
- {
- try
- {
- await Setup();
-
- Assert.IsInstanceOf<string>(sdpData.DeviceAddress, "DeviceAddress value is not of type string");
- Assert.IsNotNull(sdpData.DeviceAddress, "DeviceAddress property is null");
- Assert.True(bondedDevice.Address == sdpData.DeviceAddress, "sdpData.DeviceAddress is not equal to remote bonded device address");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("DeviceAddress_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("DeviceAddress_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test ServiceUuid. Check whether ServiceUuid is readable and writable")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothDeviceSdpData.ServiceUuid A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Open Bluetooth in Settings on test device")]
- [Precondition(3, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task ServiceUuid_PROPERTY_READ_ONLY()
- {
- try
- {
- await Setup();
-
- Assert.IsInstanceOf<IEnumerable<string>>(sdpData.ServiceUuid, "ServiceUuid value is not of type IEnumerable<string>");
-
- if (bondedDevice.ServiceCount > 0)
- {
- List<string> uuidList = bondedDevice.ServiceUuidList.ToList();
-// The sequence is possible to different as the stack's implementation
-// bool equal = uuidList.SequenceEqual(sdpData.ServiceUuid);
-// Assert.IsTrue(equal, "sdpData.ServiceUuid is not equal to the remote device uuid list");
- }
- else
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Service count is 0, so can't check the service list: PASS");
- }
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("ServiceUuid_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("ServiceUuid_PROPERTY_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-using System;
-using System.Threading.Tasks;
-using System.Linq;
-using System.Collections.Generic;
-using BluetoothNetworkUtils;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Collections.ObjectModel;
-using Tizen.System;
-
-namespace Tizen.Network.Bluetooth.Tests
-{
- [TestFixture]
- [Description("BluetoothProfile Tests")]
- public class BluetoothProfileTests
- {
- bool isBluetoothSupported = false;
-
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST");
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out isBluetoothSupported);
- }
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST");
- }
-
- [Test]
- [Category("P1")]
- [Description("Get the BluetoothProfile instance from abstract class")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BluetoothProfile.BluetoothProfile M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Paired with the remote device.")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public async Task BluetoothProfile_INIT()
- {
- try
- {
- string HspHsUuid = "00001108-0000-1000-8000-00805F9B34FB";
- string HfpHsUuid = "0000111E-0000-1000-8000-00805F9B34FB";
- string A2dpSnkUuid = "0000110B-0000-1000-8000-00805F9B34FB";
- string HidUuid = "00001124-0000-1000-8000-00805F9B34FB";
- string OppUuid = "00001105-0000-1000-8000-00805F9B34FB";
- BluetoothDevice audioDevice = null;
- BluetoothDevice avrcpDevice = null;
- BluetoothDevice hidDevice = null;
- BluetoothDevice oppClientDevice = null;
- BluetoothAudio audioProfile = null;
- BluetoothAvrcp avrcpProfile = null;
- BluetoothHid hidProfile = null;
- BluetoothOppClient oppClientProfile = null;
-
- // Get the device instance in the paired list
- IEnumerable<BluetoothDevice> list = BluetoothAdapter.GetBondedDevices();
- if (!list.Any())
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "There is no bonded device");
- Assert.True(false, "No bonded device!!");
- }
- else
- {
- foreach (BluetoothDevice item in list)
- {
- foreach (string s in item.ServiceUuidList)
- {
- if (audioDevice == null && (s.Equals(HspHsUuid) || s.Equals(HfpHsUuid)))
- {
- audioDevice = item;
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Found audio Device");
- break;
- }
- if (avrcpDevice == null && s.Equals(A2dpSnkUuid))
- {
- avrcpDevice = item;
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Found AVRCP Device");
- break;
- }
- if (hidDevice == null &&s.Equals(HidUuid))
- {
- hidDevice = item;
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Found HID Device");
- break;
- }
- if (oppClientDevice == null &&s.Equals(OppUuid))
- {
- oppClientDevice = item;
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Found OPP Device");
- break;
- }
- }
- }
- }
-
- Assert.IsTrue(!(audioDevice == null && avrcpDevice == null &&
- hidDevice == null && oppClientDevice == null),
- "[TestCase][BluetoothProfile_INIT] Failed");
-
- if (audioDevice != null)
- {
- audioProfile = audioDevice.GetProfile<BluetoothAudio>();
- Assert.IsInstanceOf<BluetoothAudio>(audioProfile, "BluetoothProfile_INIT");
- Assert.IsNotNull(audioProfile, "BluetoothProfile_INIT");
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "audioProfile Success!");
- }
-
- if (avrcpDevice != null)
- {
- avrcpProfile = avrcpDevice.GetProfile<BluetoothAvrcp>();
- Assert.IsInstanceOf<BluetoothAvrcp>(avrcpProfile, "BluetoothProfile_INIT");
- Assert.IsNotNull(avrcpProfile, "BluetoothProfile_INIT");
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "avrcpProfile Success!");
- }
-
- if (hidDevice != null)
- {
- hidProfile = hidDevice.GetProfile<BluetoothHid>();
- Assert.IsInstanceOf<BluetoothHid>(hidProfile, "BluetoothProfile_INIT");
- Assert.IsNotNull(hidProfile, "BluetoothProfile_INIT");
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "hidProfile Success!");
- }
-
- if (oppClientDevice != null)
- {
- oppClientProfile = oppClientDevice.GetProfile<BluetoothOppClient>();
- Assert.IsInstanceOf<BluetoothOppClient>(oppClientProfile, "BluetoothProfile_INIT");
- Assert.IsNotNull(oppClientProfile, "BluetoothProfile_INIT");
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "oppClientDevice Success!");
- }
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false)
- {
- BluetoothHelper.DisplayLabel("BluetoothProfile_INIT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("BluetoothProfile_INIT");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-using System;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.System;
-using Xamarin.Forms;
-using BluetoothNetworkUtils;
-
-namespace Tizen.Network.Bluetooth.Tests
-{
- [TestFixture]
- [Description("BondCreatedEventArgs Tests")]
- public class BondCreatedEventArgsTests
- {
- static bool flagDeviceDiscovery = false;
- static BluetoothDevice device = null;
- static BluetoothDevice bondedDevice = null;
- static bool isBluetoothSupported = false;
- static bool isBluetoothLeSupported = false;
- public static string remote_addr = PreconditionUtils.GetBtAddress();
- public static string default_remote_addr = PreconditionUtils.GetDefaultAddress();
-
- [SetUp]
- public static void Init()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST");
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out isBluetoothSupported);
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth.le", out isBluetoothLeSupported);
- }
- [TearDown]
- public static void Destroy()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST");
- }
-
- public static async Task WaitForDiscoveryFlag()
- {
- int count = 0;
- while(true)
- {
- await Task.Delay(1000);
- count++;
- if (flagDeviceDiscovery)
- break;
- if (count == 8)
- break;
- }
- }
-
- public static void EventHandlerDiscoveryChanged(object sender, DiscoveryStateChangedEventArgs e)
- {
- if (e.DiscoveryState == BluetoothDeviceDiscoveryState.Found)
- {
- if (remote_addr.Equals(default_remote_addr))
- {
- if (flagDeviceDiscovery == true)
- return;
-
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Use the first found device");
- }
- else if (e.DeviceFound.Address.Equals(remote_addr))
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Found the matching device: " + e.DeviceFound.Address);
- }
- else
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Exception: " + e.DeviceFound.Address);
- return;
- }
-
- device = e.DeviceFound;
- flagDeviceDiscovery = true;
- }
- }
-
- public static void EventHandlerBondCreated(object sender, BondCreatedEventArgs e)
- {
- if (e.Result == 0 && e.Device != null)
- {
- ManualTest.Confirm();
- bondedDevice = e.Device;
- }
- }
-
- public static async Task Setup()
- {
- // PRECONDITION
- if (device == null)
- {
- BluetoothAdapter.DiscoveryStateChanged += EventHandlerDiscoveryChanged;
- BluetoothAdapter.StartDiscovery();
- await WaitForDiscoveryFlag();
-
- if (BluetoothAdapter.IsDiscoveryInProgress)
- {
- BluetoothAdapter.StopDiscovery();
- await Task.Delay(1000);
- }
-
- Assert.IsNotNull(device, "Device found during discovery should not be null");
- BluetoothAdapter.DiscoveryStateChanged -= EventHandlerDiscoveryChanged;
- }
-
- // TEST CODE
- device.BondCreated += EventHandlerBondCreated;
- device.CreateBond();
- await ManualTest.WaitForConfirm();
-
- // POSTCONDITION
- device.BondCreated -= EventHandlerBondCreated;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Result. Check if Result has proper value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BondCreatedEventArgs.Result A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task Result_READ_ONLY()
- {
- try
- {
- if (bondedDevice == null)
- {
- await Setup();
- }
-
- Assert.IsNotNull(bondedDevice, "Bonded device should not be null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("Result_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("Result_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Device. Check if Device has proper value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BondCreatedEventArgs.Device A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task Device_READ_ONLY()
- {
- try
- {
- if (bondedDevice == null)
- {
- await Setup();
- }
-
- Assert.IsNotNull(bondedDevice, "Bonded device should not be null");
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("Device_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("Device_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-using System;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.System;
-using Xamarin.Forms;
-using BluetoothNetworkUtils;
-
-namespace Tizen.Network.Bluetooth.Tests
-{
- [TestFixture]
- [Description("BondDestroyedEventArgs Tests")]
- public class BondDestroyedEventArgsTests
- {
- static bool flagDeviceDiscovery = false;
- static bool flagBondCreated = false;
- static BluetoothDevice device = null;
- static string address;
- static bool isBluetoothSupported = false;
- static bool isBluetoothLeSupported = false;
- public static string remote_addr = PreconditionUtils.GetBtAddress();
- public static string default_remote_addr = PreconditionUtils.GetDefaultAddress();
-
- [SetUp]
- public static void Init()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST");
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth.le", out isBluetoothLeSupported);
- }
- [TearDown]
- public static void Destroy()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST");
- }
-
- public static async Task WaitForDiscoveryflag()
- {
- int count = 0;
- while(true)
- {
- await Task.Delay(1000);
- count++;
- if (flagDeviceDiscovery)
- break;
- if (count == 15)
- break;
- }
- }
-
- public static async Task WaitForBondflag()
- {
- int count = 0;
- while(true)
- {
- await Task.Delay(1000);
- count++;
- if (flagBondCreated)
- break;
- if (count == 9)
- break;
- }
- }
-
- public static void EventHandlerDiscoveryChanged(object sender, DiscoveryStateChangedEventArgs e)
- {
- if (e.DiscoveryState == BluetoothDeviceDiscoveryState.Found)
- {
- if (remote_addr.Equals(default_remote_addr))
- {
- if (flagDeviceDiscovery == true)
- return;
-
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Use the first found device");
- }
- else if (e.DeviceFound.Address.Equals(remote_addr))
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Found the matching device: " + e.DeviceFound.Address);
- }
- else
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Exception: " + e.DeviceFound.Address);
- return;
- }
-
- device = e.DeviceFound;
- flagDeviceDiscovery = true;
- }
- }
-
- public static void EventHandlerBondCreated(object sender, BondCreatedEventArgs e)
- {
- flagBondCreated = true;
- }
-
- public static void EventHandlerBondDestroyed(object sender, BondDestroyedEventArgs e)
- {
- if (e.Result == 0 && e.DeviceAddress != null)
- {
- address = e.DeviceAddress;
- ManualTest.Confirm();
- }
- }
-
- public static async Task Setup()
- {
- // PRECONDITION
- if (device == null)
- {
- BluetoothAdapter.DiscoveryStateChanged += EventHandlerDiscoveryChanged;
- BluetoothAdapter.StartDiscovery();
- await WaitForDiscoveryflag();
-
- if (BluetoothAdapter.IsDiscoveryInProgress)
- {
- BluetoothAdapter.StopDiscovery();
- await Task.Delay(1000);
- }
-
- Assert.IsNotNull(device, "Device found during discovery should not be null");
- BluetoothAdapter.DiscoveryStateChanged -= EventHandlerDiscoveryChanged;
- }
- device.BondCreated += EventHandlerBondCreated;
- device.CreateBond();
- await WaitForBondflag();
-
- // TEST CODE
- device.BondDestroyed += EventHandlerBondDestroyed;
- device.DestroyBond();
- await ManualTest.WaitForConfirm();
-
- // POSTCONDITION
- device.BondCreated -= EventHandlerBondCreated;
- device.BondDestroyed -= EventHandlerBondDestroyed;
- flagBondCreated = false;
- Assert.AreEqual(device.Address, address, "Bonded device address must be same as address of destroyed bond device");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Result. Check if Result has proper value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BondDestroyedEventArgs.Result A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task Result_READ_ONLY()
- {
- try
- {
- await Setup();
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("Result_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("Result_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test DeviceAddress. Check if DeviceAddress has proper value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.BondDestroyedEventArgs.DeviceAddress A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "When pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task DeviceAddress_READ_ONLY()
- {
- try
- {
- await Setup();
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("DeviceAddress_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("DeviceAddress_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-using System;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.System;
-using Xamarin.Forms;
-using BluetoothNetworkUtils;
-
-namespace Tizen.Network.Bluetooth.Tests
-{
- [TestFixture]
- [Description("DeviceConnectionStateChangedEventArgs Tests")]
- public class DeviceConnectionStateChangedEventArgsTests
- {
- static bool flagDeviceDiscovery = false;
- static BluetoothDevice device = null;
- static bool isBluetoothSupported = false;
- public static string remote_addr = PreconditionUtils.GetBtAddress();
- public static string default_remote_addr = PreconditionUtils.GetDefaultAddress();
-
- [SetUp]
- public static void Init()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST");
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out isBluetoothSupported);
- }
- [TearDown]
- public static void Destroy()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST");
- }
-
- public static async Task WaitForDiscoveryFlag()
- {
- int count = 0;
- while(true)
- {
- await Task.Delay(1000);
- count++;
- if (flagDeviceDiscovery)
- break;
- if (count == 8)
- break;
- }
- }
-
- public static void EventHandlerDiscoveryChanged(object sender, DiscoveryStateChangedEventArgs e)
- {
- if (e.DiscoveryState == BluetoothDeviceDiscoveryState.Found)
- {
- if (remote_addr.Equals(default_remote_addr))
- {
- if (flagDeviceDiscovery == true)
- return;
-
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Use the first found device");
- }
- else if (e.DeviceFound.Address.Equals(remote_addr))
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Found the matching device: " + e.DeviceFound.Address);
- }
- else
- {
- LogUtils.Write (LogUtils.DEBUG, LogUtils.TAG, "Exception: " + e.DeviceFound.Address);
- return;
- }
-
- device = e.DeviceFound;
- flagDeviceDiscovery = true;
- }
- }
-
- public static void EventHandlerConnectionStateChanged(object sender, DeviceConnectionStateChangedEventArgs e)
- {
- if (e.IsConnected && e.ConnectionData != null)
- ManualTest.Confirm();
- }
-
- public static async Task Setup()
- {
- // PRECONDITION
- if (device == null)
- {
- BluetoothAdapter.DiscoveryStateChanged += EventHandlerDiscoveryChanged;
- BluetoothAdapter.StartDiscovery();
- await WaitForDiscoveryFlag();
-
- if (BluetoothAdapter.IsDiscoveryInProgress)
- {
- BluetoothAdapter.StopDiscovery();
- await Task.Delay(1000);
- }
-
- Assert.IsNotNull(device, "Device found during discovery should not be null");
- }
-
- // TEST CODE
- device.ConnectionStateChanged += EventHandlerConnectionStateChanged;
- device.CreateBond();
- await ManualTest.WaitForConfirm();
-
- // POSTCONDITION
- device.ConnectionStateChanged -= EventHandlerConnectionStateChanged;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IsConnected. Check if IsConnected has proper value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.DeviceConnectionStateChangedEventArgs.IsConnected A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task IsConnected_READ_ONLY()
- {
- // TEST CODE
- try
- {
- await Setup();
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false)
- {
- BluetoothHelper.DisplayLabel("IsConnected_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("IsConnected_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test ConnectionData. Check if ConnectionData has proper value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.DeviceConnectionStateChangedEventArgs.ConnectionData A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Keep all the bluetooth discoverable devices near the test device.")]
- [Step(1, "Tap the Run button")]
- [Step(2, "If and when pairing popup appears, tap confirm on test device and remote device.")]
- [Postcondition(1, "NA")]
- public static async Task ConnectionData_READ_ONLY()
- {
- try
- {
- await Setup();
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false)
- {
- BluetoothHelper.DisplayLabel("ConnectionData_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("ConnectionData_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-using System;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-using System.Linq;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.System;
-using Xamarin.Forms;
-
-namespace Tizen.Network.Bluetooth.Tests
-{
- [TestFixture]
- [Description("ServiceSearchedEventArgs Tests")]
- public class ServiceSearchedEventArgsTests
- {
- static BluetoothDevice bondedDevice = null;
- static bool isBluetoothSupported = false;
- static bool isBluetoothLeSupported = false;
-
- [SetUp]
- public static void Init()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Preconditions for each TEST");
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out isBluetoothSupported);
- Information.TryGetValue("http://tizen.org/feature/network.bluetooth.le", out isBluetoothLeSupported);
- }
- [TearDown]
- public static void Destroy()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.INFO, "Postconditions for each TEST");
- }
-
- public static void EventHandlerServiceSearched(object sender, ServiceSearchedEventArgs e)
- {
- if (e.SdpData != null && e.Result == 0)
- {
- ManualTest.Confirm();
- }
- }
-
- public static async Task Setup()
- {
- // PRECONDITION
- if (bondedDevice == null)
- {
- IEnumerable<BluetoothDevice> list = BluetoothAdapter.GetBondedDevices ();
- bondedDevice = list.ElementAt(0);
- Assert.IsNotNull (bondedDevice, "Bonded Device should not be null");
- }
-
- // TEST CODE
- bondedDevice.ServiceSearched += EventHandlerServiceSearched;
- bondedDevice.StartServiceSearch();
- await ManualTest.WaitForConfirm();
-
- // POSTCONDITION
- bondedDevice.ServiceSearched -= EventHandlerServiceSearched;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test SdpData. Check if SdpData has proper value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.ServiceSearchedEventArgs.SdpData A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Open Bluetooth in Settings on test device")]
- [Precondition(3, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task SdpData_READ_ONLY()
- {
- try
- {
- await Setup();
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("SdpData_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("SdpData_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Result. Check the Result value")]
- [Property("SPEC", "Tizen.Network.Bluetooth.ServiceSearchedEventArgs.Result A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Shikha, shikha.ta@samsung.com")]
- [Precondition(1, "Turn on the bluetooth")]
- [Precondition(2, "Open Bluetooth in Settings on test device")]
- [Precondition(3, "Pair with atleast one nearby bluetooth device")]
- [Step(1, "Tap the Run button")]
- [Postcondition(1, "NA")]
- public static async Task Result_READ_ONLY()
- {
- try
- {
- await Setup();
- }
- catch (NotSupportedException)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false)
- {
- BluetoothHelper.DisplayLabel("Result_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (TypeInitializationException e)
- {
- if (isBluetoothSupported == false && isBluetoothLeSupported == false
- && e.InnerException.GetType() == typeof(NotSupportedException))
- {
- BluetoothHelper.DisplayLabel("Result_READ_ONLY");
- await ManualTest.WaitForConfirm();
- }
- }
- catch (Exception ex)
- {
- Assert.True(false, "Exception occurs. Msg : " + ex.ToString());
- }
-
- }
- }
-}