public void testBeaconDoesNotMatchRegionWithDiffrentBluetoothMac() { Beacon beacon = new AltBeacon.Builder().SetId1("1").SetId2("2").SetId3("3").SetRssi(4) .SetBeaconTypeCode(5).SetTxPower(6).SetBluetoothAddress("01:02:03:04:05:06").Build(); Region region = new Region("myRegion", "01:02:03:04:05:99"); AssertEx.False("Beacon should match region with mac the same", region.MatchesBeacon(beacon)); }
public void testBeaconDoesntMatchRegionWithLongerIdentifierList() { Beacon beacon = new Beacon.Builder().SetId1("1").SetId2("2").SetRssi(4) .SetBeaconTypeCode(5).SetTxPower(6).SetBluetoothAddress("1:2:3:4:5:6").Build(); Region region = new Region("myRegion", Identifier.Parse("1"), Identifier.Parse("2"), Identifier.Parse("3")); AssertEx.False("Beacon should not match region with more identifers than the beacon", region.MatchesBeacon(beacon)); }
public void testSecondDuplicatePacketIsNotDistinct() { DistinctPacketDetector dpd = new DistinctPacketDetector(); dpd.IsPacketDistinct("01:02:03:04:05:06", new byte[] { 0x01, 0x02 }); bool secondResult = dpd.IsPacketDistinct("01:02:03:04:05:06", new byte[] { 0x01, 0x02 }); AssertEx.False("second call with same packet should not be distinct", secondResult); }