public async Task GetAvailableRegionsTest_MakeServiceCall() { AvailableRegionsProvider provider = new AvailableRegionsProvider(_regionService.Object); Dictionary <int, string> result = (Dictionary <int, string>) await provider.GetAvailableRegionsAsync(); Assert.Equal("Kyiv", result[1]); Assert.Equal("Lviv", result[2]); }
public async Task GetAvailableRegionsTest_GetDataFromCache() { AvailableRegionsProvider provider = new AvailableRegionsProvider(_regionService.Object); await provider.GetAvailableRegionsAsync(); Dictionary <int, string> result = (Dictionary <int, string>) await provider.GetAvailableRegionsAsync(); Assert.Equal("Kyiv", result[1]); Assert.Equal("Lviv", result[2]); _regionService.Verify(mock => mock.GetAvailableRegionsAsync(), Times.Once); }