private async Task RegisterLocation(IMEIToCallsign imei, DateTimeOffset readingTime, DateTimeOffset receivedTime, decimal latitude, decimal longitude, bool shouldStore = true, bool shouldUseResolver = false)
        {
            var locations = MockHelpers.CreateMockLocationDbSet(GoodLocations);
            var context = CreateMockLocationContext(locations.Object);
            var imeiService = CreateMockIMEIService();
            var container = new UnityContainer();

            container.RegisterInstance(imeiService.Object);

            DependencyResolver.SetResolver(new UnityDependencyResolver(container));

            var service = new LocationService(context.Object, shouldUseResolver ? null : imeiService.Object);

            await service.RegisterLocation(imei.IMEI, readingTime, receivedTime, latitude, longitude);

            if (shouldStore)
            {
                locations.Verify(l => l.Add(It.Is<LocationRecord>(lr => ValidateLocationRecord(lr, imei, latitude, longitude, readingTime, receivedTime))));
                context.Verify(c => c.SaveChangesAsync());
            }
        }