public async Task Map_NoLocationResults_Success() { // ARRANGE var configurationMock = new Mock <IConfiguration>(); var resourceLoaderMock = new Mock <IResourceLoader>(); var unitUnderTest = new AgencyMapper(configurationMock.Object, resourceLoaderMock.Object); var expected = new List <AgencyResponse> { new AgencyResponse { id = 4321, subdomain = "hisc1234" } }; resourceLoaderMock.Setup(mock => mock.LoadAsync <AgencyResponse>(It.IsAny <string>())) .ReturnsAsync(expected) .Verifiable(); // ACT var results = await unitUnderTest.Map(); // ASSERT resourceLoaderMock.Verify(); Assert.AreEqual(expected: expected.Count, results.Count); Assert.AreEqual(expected.First().id, results.First().clear_care_agency); Assert.IsTrue(results.First().franchise_numbers.First().EndsWith("1234")); }
public async Task Map_NoResults_Success() { // ARRANGE var configurationMock = new Mock <IConfiguration>(); var resourceLoaderMock = new Mock <IResourceLoader>(); var unitUnderTest = new AgencyMapper(configurationMock.Object, resourceLoaderMock.Object); resourceLoaderMock.Setup(mock => mock.LoadAsync <AgencyResponse>(It.IsAny <string>())) .ReturnsAsync(new List <AgencyResponse>()) .Verifiable(); // ACT var agencies = await unitUnderTest.Map(); // ASSERT resourceLoaderMock.Verify(); Assert.AreEqual(expected: 0, agencies.Count); }