Exemple #1
0
        public void CalculateLocationDistances_GivenLocations_ExpectDistancesAdded()
        {
            ConcurrentBag <LocationImpl> locations = new ConcurrentBag <LocationImpl>()
            {
                location1, location2, location3, location4
            };

            locationService.CalculateLocationDistances(locations);

            LocationImpl result = locations.First(loc => loc.Coordinates.Latitude.Equals(5.0));

            Assert.Equal(location3.Guid, result.DistanceToOthers.ElementAt(0).Value);
            Assert.Equal(location4.Guid, result.DistanceToOthers.ElementAt(1).Value);
            Assert.Equal(location2.Guid, result.DistanceToOthers.ElementAt(2).Value);
        }