示例#1
0
        public void TestBeaconsWithDifferentId3AreNotEqual()
        {
            Beacon beacon1 = new AltBeacon.Builder().SetMfgReserved(7).SetId1("1").SetId2("2").SetId3("3").SetRssi(4)
                             .SetBeaconTypeCode(5).SetTxPower(6)
                             .SetBluetoothAddress("1:2:3:4:5:6").Build();
            Beacon beacon2 = new AltBeacon.Builder().SetMfgReserved(7).SetId1("1").SetId2("2").SetId3("13").SetRssi(4)
                             .SetBeaconTypeCode(5).SetTxPower(6)
                             .SetBluetoothAddress("1:2:3:4:5:6").Build();

            AssertEx.True("Beacons with different id3 are not equal", !beacon1.Equals(beacon2));
        }
示例#2
0
        public void TestBeaconsWithSameMacsAreEqual()
        {
            Beacon.SetHardwareEqualityEnforced(true);
            Beacon beacon1 = new AltBeacon.Builder().SetMfgReserved(7).SetId1("1").SetId2("2").SetId3("3").SetRssi(4)
                             .SetBeaconTypeCode(5).SetTxPower(6)
                             .SetBluetoothAddress("1:2:3:4:5:6").Build();
            Beacon beacon2 = new AltBeacon.Builder().SetMfgReserved(7).SetId1("1").SetId2("2").SetId3("3").SetRssi(4)
                             .SetBeaconTypeCode(5).SetTxPower(6)
                             .SetBluetoothAddress("1:2:3:4:5:6").Build();

            AssertEx.True("Beacons with same same macs are equal", beacon1.Equals(beacon2));
        }
示例#3
0
        public void TestBeaconsWithSameIdentifersAreEqual()
        {
            Beacon beacon1 = new AltBeacon.Builder().SetMfgReserved(7).SetId1("1").SetId2("2").SetId3("3").SetRssi(4)
                             .SetBeaconTypeCode(5).SetTxPower(6)
                             .SetBluetoothAddress("1:2:3:4:5:6").Build();
            Beacon beacon2 = new AltBeacon.Builder().SetMfgReserved(7).SetId1("1").SetId2("2").SetId3("3").SetRssi(4)
                             .SetBeaconTypeCode(5).SetTxPower(6)
                             .SetBluetoothAddress("1:2:3:4:5:6").Build();

            //AssertEx.AreEqual("Beacons with same identifiers are equal", beacon1, beacon2);
            AssertEx.True("Beacons with same identifiers are equal", beacon1.Equals(beacon2));
        }