コード例 #1
0
        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]);
        }
コード例 #2
0
        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);
        }