public void gattBeaconExtraDataIsNotReturned()
        {
            Beacon extraDataBeacon         = getGattBeaconExtraData();
            ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker();
            Beacon trackedBeacon           = tracker.Track(extraDataBeacon);

            AssertEx.Null("trackedBeacon should be null", trackedBeacon);
        }
        public void trackingManufacturerBeaconReturnsSelf()
        {
            Beacon beacon = getManufacturerBeacon();
            ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker();
            Beacon trackedBeacon           = tracker.Track(beacon);

            AssertEx.AreEqual("Returns itself", trackedBeacon, beacon);
        }
        public void gattBeaconExtraDataAreNotOverwritten()
        {
            Beacon beacon                  = getGattBeacon();
            Beacon extraDataBeacon         = getGattBeaconExtraData();
            ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker();

            tracker.Track(beacon);
            tracker.Track(extraDataBeacon);
            Beacon trackedBeacon = tracker.Track(beacon);

            AssertEx.AreEqual("extra data should not be overwritten", extraDataBeacon.DataFields, trackedBeacon.ExtraDataFields);
        }
        public void multiFrameBeaconProgramaticParserAssociationDifferentServiceUUIDFieldsGetUpdated()
        {
            Beacon beacon                  = getMultiFrameBeacon();
            Beacon beaconUpdate            = getMultiFrameBeaconUpdateDifferentServiceUUID();
            ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker(false);

            tracker.Track(beacon);
            tracker.Track(beaconUpdate);
            Beacon trackedBeacon = tracker.Track(beacon);

            AssertEx.AreEqual("rssi should be updated", beaconUpdate.Rssi, trackedBeacon.Rssi);
            AssertEx.AreEqual("data fields should be updated", beaconUpdate.DataFields, trackedBeacon.ExtraDataFields);
        }
        public void multiFrameBeaconDifferentServiceUUIDFieldsNotUpdated()
        {
            Beacon beacon                  = getMultiFrameBeacon();
            Beacon beaconUpdate            = getMultiFrameBeaconUpdateDifferentServiceUUID();
            ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker();

            tracker.Track(beacon);
            tracker.Track(beaconUpdate);
            Beacon trackedBeacon = tracker.Track(beacon);

            AssertEx.AreNotEqual("rssi should NOT be updated", beaconUpdate.Rssi, trackedBeacon.Rssi);
            AssertEx.AreNotEqual("data fields should NOT be updated", beaconUpdate.DataFields, trackedBeacon.ExtraDataFields);
        }
        public void gattBeaconFieldsGetUpdated()
        {
            Beacon beacon                  = getGattBeacon();
            Beacon beaconUpdate            = getGattBeaconUpdate();
            Beacon extraDataBeacon         = getGattBeaconExtraData();
            ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker();

            tracker.Track(beacon);
            Beacon trackedBeacon = tracker.Track(beaconUpdate);

            AssertEx.AreEqual("rssi should be updated", beaconUpdate.Rssi, trackedBeacon.Rssi);
            AssertEx.AreEqual("data fields should be updated", beaconUpdate.DataFields, trackedBeacon.DataFields);
        }
        public void gattBeaconExtraDataGetUpdated()
        {
            Beacon beacon                  = getGattBeacon();
            Beacon extraDataBeacon         = getGattBeaconExtraData();
            Beacon extraDataBeacon2        = getGattBeaconExtraData2();
            ExtraDataBeaconTracker tracker = new ExtraDataBeaconTracker();

            tracker.Track(beacon);
            tracker.Track(extraDataBeacon);
            tracker.Track(extraDataBeacon2);
            Beacon trackedBeacon = tracker.Track(beacon);

            AssertEx.AreEqual("extra data is updated", extraDataBeacon2.DataFields, trackedBeacon.ExtraDataFields);
        }