示例#1
0
        public async Task GasStationFinder_Find_CallsMyGasFeed()
        {
            // Arrange
            var gasDataRequest = GasDataHelper.GetRequest();
            var finder         = new GasStationFinder(new HttpClient());

            // Act
            var result = await finder.Find(gasDataRequest).ConfigureAwait(false);

            // Assert
            Assert.IsInstanceOf(typeof(GasDataResponse), result);
        }
示例#2
0
        public async Task GasStationFinder_Find_ReturnsGasDataResponse()
        {
            // Arrange
            var gasDataResponse = GasDataHelper.OK_EmptyStations();

            _fakeHttpMessageHandler.Setup(f => f.Send(It.IsAny <HttpRequestMessage>())).Returns(new HttpResponseMessage
            {
                StatusCode = HttpStatusCode.OK,
                Content    = new StringContent(gasDataResponse.ToJson())
            });
            var finder = new GasStationFinder(_http);

            // Act
            var result = await finder.Find(new GasDataRequest()).ConfigureAwait(false);

            // Assert
            Assert.IsInstanceOf(typeof(GasDataResponse), result);
        }