public async Task LookupZips_ValidInput_ReturnsZipCodes()
        {
            var zipCodes = await serviceUnderTest.LookupZipCodes(VALID_CITY, VALID_STATE);

            Assert.AreEqual(2, zipCodes.Count);

            mockHandler.Protected().Verify(
                "SendAsync",
                Times.Exactly(1),
                ItExpr.Is <HttpRequestMessage>(req => req.Method == HttpMethod.Get),
                ItExpr.IsAny <CancellationToken>());
        }
Пример #2
0
        public async Task <IEnumerable <string> > GetZipCodes([FromQuery] string city, [FromQuery] string state)
        {
            if (string.IsNullOrEmpty(city) || string.IsNullOrEmpty(state))
            {
                return(new List <string>());
            }

            return(await _zipCodeService.LookupZipCodes(city, state));
        }