public void OpenSocketTestDevicePaired() { Bluetooth bt = new Bluetooth(); if (bt.AdapterEnabled) { List <BluetoothDevice> devices = bt.PairedDevices; foreach (BluetoothDevice device in devices) { if (device.Name.Equals("HC-05")) { bt.SelectedDevice = device; break; } } bool open = bt.OpenSocket(); Thread.Sleep(500); bt.CloseSocket(); Assert.IsTrue(open); } else { Assert.IsTrue(true, "Adapter not enabled"); } }