Search in sources :

Example 1 with StaticBeaconSimulator

use of org.altbeacon.beacon.simulator.StaticBeaconSimulator in project android-beacon-library by AltBeacon.

the class BeaconSimulatorTest method testSetBeaconsNull.

@Test
public void testSetBeaconsNull() {
    StaticBeaconSimulator staticBeaconSimulator = new StaticBeaconSimulator();
    staticBeaconSimulator.setBeacons(null);
    assertEquals("getBeacons should return null", staticBeaconSimulator.getBeacons(), null);
}
Also used : StaticBeaconSimulator(org.altbeacon.beacon.simulator.StaticBeaconSimulator) Test(org.junit.Test)

Example 2 with StaticBeaconSimulator

use of org.altbeacon.beacon.simulator.StaticBeaconSimulator in project android-beacon-library by AltBeacon.

the class BeaconSimulatorTest method testSetBeaconsEmpty.

@Test
public void testSetBeaconsEmpty() {
    StaticBeaconSimulator staticBeaconSimulator = new StaticBeaconSimulator();
    ArrayList<Beacon> beacons = new ArrayList<Beacon>();
    staticBeaconSimulator.setBeacons(beacons);
    assertEquals("getBeacons should match values entered with setBeacons even when empty", staticBeaconSimulator.getBeacons(), beacons);
}
Also used : StaticBeaconSimulator(org.altbeacon.beacon.simulator.StaticBeaconSimulator) ArrayList(java.util.ArrayList) Beacon(org.altbeacon.beacon.Beacon) AltBeacon(org.altbeacon.beacon.AltBeacon) Test(org.junit.Test)

Example 3 with StaticBeaconSimulator

use of org.altbeacon.beacon.simulator.StaticBeaconSimulator in project android-beacon-library by AltBeacon.

the class BeaconSimulatorTest method testSetBeacons.

@Test
public void testSetBeacons() {
    StaticBeaconSimulator staticBeaconSimulator = new StaticBeaconSimulator();
    byte[] beaconBytes = hexStringToByteArray("02011a1bff1801beac2f234454cf6d4a0fadf2f4911ba9ffa600010002c509");
    Beacon beacon = new AltBeaconParser().fromScanData(beaconBytes, -55, null);
    ArrayList<Beacon> beacons = new ArrayList<Beacon>();
    beacons.add(beacon);
    staticBeaconSimulator.setBeacons(beacons);
    assertEquals("getBeacons should match values entered with setBeacons", staticBeaconSimulator.getBeacons(), beacons);
}
Also used : StaticBeaconSimulator(org.altbeacon.beacon.simulator.StaticBeaconSimulator) AltBeaconParser(org.altbeacon.beacon.AltBeaconParser) Beacon(org.altbeacon.beacon.Beacon) AltBeacon(org.altbeacon.beacon.AltBeacon) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

StaticBeaconSimulator (org.altbeacon.beacon.simulator.StaticBeaconSimulator)3 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)2 AltBeacon (org.altbeacon.beacon.AltBeacon)2 Beacon (org.altbeacon.beacon.Beacon)2 AltBeaconParser (org.altbeacon.beacon.AltBeaconParser)1