Ejemplo n.º 1
0
        public async Task <Kilometer> GetDistanceBetweenLocations(Location a, Location b)
        {
            var request  = _getDistanceRequestMapper.Map(a, b);
            var response = await _httpClient.PostAsync(distanceEndpointAddress, request);

            return(_getDistanceResponseMapper.Map(response));
        }
        public async Task WhenResponse_ShouldReturnWhateverResponseMapperReturns()
        {
            // Arrange
            var expected = _fixture.Create <Kilometer>();

            _getDistanceResponseMapper
            .Map(Arg.Any <HttpResponseMessage>())
            .Returns(expected);

            // Act
            var actual = await _sut.GetDistanceBetweenLocations(_from, _to);

            // Assert
            actual.Should().Be(expected);
        }