コード例 #1
0
        public async Task DistanceDurationBetweenLocationsCoordinates()
        {
            // Inject
            // Arrange
            var expected = new GoogleDataObject()
            {
                Distance = "130 km", Duration = "2 hours 4 mins"
            };

            var loc1 = new GoogleDataObject()
            {
                Latitude = 42.504792599999988, Longitude = 27.4626361
            };
            var loc2 = new GoogleDataObject()
            {
                Latitude = 43.2140504, Longitude = 27.9147333
            };


            // Act
            var result = await service.DistanceDurationBetweenLocations(loc1, loc2);

            // Assert
            Assert.Equal(Serialize(expected), Serialize(result));
        }