Skip to content

Commit

Permalink
Verify stopRangingBeaconsInRegion
Browse files Browse the repository at this point in the history
  • Loading branch information
Vandalko committed Jul 24, 2020
1 parent 7877160 commit 58dd8a9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/src/test/java/org/altbeacon/beacon/BeaconManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,26 @@ public void startRangingBeaconsInRegionMultipleInvocationsTest() throws Exceptio
assertEquals(beaconManager.getRangedRegions().size(), 2);
}

@Test
public void stopRangingBeaconsInRegionTest() throws Exception {
BeaconManager beaconManager = BeaconManager
.getInstanceForApplication(RuntimeEnvironment.application);

String id = "id";
Region region1 = new Region(id, Collections.<Identifier>emptyList());
Region region2 = new Region(id, "00:11:22:33:FF:EE");
Region region3 = new Region(id + "-other", Collections.<Identifier>emptyList());

beaconManager.startRangingBeaconsInRegion(region1);
beaconManager.startRangingBeaconsInRegion(region2);
beaconManager.startRangingBeaconsInRegion(region3);
assertEquals(beaconManager.getRangedRegions().size(), 2);

beaconManager.stopRangingBeaconsInRegion(region1);
assertEquals(beaconManager.getRangedRegions().size(), 1);

beaconManager.stopRangingBeaconsInRegion(region3);
assertEquals(beaconManager.getRangedRegions().size(), 0);
}

}

0 comments on commit 58dd8a9

Please sign in to comment.