public void Dev1() { var f = AndroidTestInfra.Init(); var bdi = f.DoGetBluetoothDeviceInfo(BluetoothAddress.Parse(Dev1AddrTxt)); // Assert.AreEqual(BluetoothAddress.Parse(Dev1AddrTxt), bdi.DeviceAddress, "r.LocalAddress"); Assert.AreEqual(Dev1Name, bdi.DeviceName, "r.DeviceName"); Assert.AreEqual(Dev1CoD, bdi.ClassOfDevice, "r.ClassOfDevice"); Assert.AreEqual(DateTime.MinValue, bdi.LastSeen, "r.LastSeen"); Assert.AreEqual(DateTime.MinValue, bdi.LastUsed, "r.LastUsed"); Assert.AreEqual(false, bdi.Remembered, "r.Remembered"); Assert.AreEqual(false, bdi.Authenticated, "r.Authenticated"); Assert.AreEqual(false, bdi.Connected, "r.Connected"); try { bdi.GetVersions(); } catch (NotSupportedException) { } Assert.AreEqual(int.MinValue, bdi.Rssi, "r.Rssi"); }
//--- IBluetoothRadio TestRadioStates(RadioModes expectedModes, RadioMode expectedMode, HardwareStatus expectedStatus, Android.Bluetooth.State state, Android.Bluetooth.ScanMode scanMode) { var values = new AndroidMockValues { Radio_Address = "10:23:45:67:89:ab", Radio_Name = "radio2222", Radio_State = state, Radio_ScanMode = scanMode, }; var f = AndroidTestInfra.Init(values); var r = f.DoGetPrimaryRadio(); // Assert.AreEqual(expectedMode, r.Mode, "r.Mode"); Assert.AreEqual(expectedModes, r.Modes, "r.Modes"); Assert.AreEqual(expectedStatus, r.HardwareStatus, "r.HardwareStatus"); return(r); }
public void Radio2_OffConno() { var values = new AndroidMockValues { Radio_Address = "10:23:45:67:89:ab", Radio_Name = "radio2222", Radio_State = Android.Bluetooth.State.Off, Radio_ScanMode = Android.Bluetooth.ScanMode.Connectable, }; var f = AndroidTestInfra.Init(values); var r = f.DoGetPrimaryRadio(); Assert.AreEqual(BluetoothAddress.Parse(values.Radio_Address), r.LocalAddress, "r.LocalAddress"); Assert.AreEqual(values.Radio_Name, r.Name, "r.Name"); Assert.AreEqual(Manu, r.SoftwareManufacturer, "r.SoftwareManufacturer"); // HA-CK Assert.AreEqual(Manufacturer.Unknown, r.Manufacturer, "r.Manufacturer"); Assert.AreEqual(new ClassOfDevice(0), r.ClassOfDevice, "r.Manufacturer"); // Assert.AreEqual(RadioMode.PowerOff, r.Mode, "r.Mode"); Assert.AreEqual(RadioModes.Connectable | RadioModes.PowerOff, r.Modes, "r.Modes"); Assert.AreEqual(HardwareStatus.Shutdown, r.HardwareStatus, "r.HardwareStatus"); }
public void RadioMisc() { var f = AndroidTestInfra.Init(); var rList = f.DoGetAllRadios(); Assert.AreEqual(1, rList.Length, "rList.Length"); var r = rList[0]; Assert.AreEqual(BluetoothAddress.Parse(LocalAddrTxt), r.LocalAddress, "r.LocalAddress"); Assert.AreEqual(LocalName, r.Name, "r.Name"); Assert.AreEqual(Manu, r.SoftwareManufacturer, "r.SoftwareManufacturer"); // HA-CK Assert.AreEqual(Manufacturer.Unknown, r.Manufacturer, "r.Manufacturer"); Assert.AreEqual(new ClassOfDevice(CoD), r.ClassOfDevice, "r.Manufacturer"); // Assert.AreEqual(Mode, r.Mode, "r.Mode"); Assert.AreEqual(Modes, r.Modes, "r.Modes"); Assert.AreEqual(HardwareStatus.Running, r.HardwareStatus, "r.HardwareStatus"); // Assert.AreEqual(HciVersion.Unknown, r.HciVersion, "r.HciVersion"); Assert.AreEqual(0, r.HciRevision, "r.HciRevision"); // Assert.AreEqual(IntPtr.Zero, r.Handle, "r.Handle"); }