public async Task RetrieveAsyncGetsValue()
        {
            //arrange
            _repository.GetAsync().Returns(10);

            //act
            ICounterService service  = new CounterService(_repository);
            int             expected = await service.RetrieveAsync();

            //assert
            Assert.Equal(10, expected);
        }
Пример #2
0
        public async Task <SlimCounterViewModel> GetCounterInfoAsync(int id)
        {
            CounterModel _cm = await _counterRepository.GetAsync(id);

            if (_cm == null)
            {
                return(null);
            }

            return(new SlimCounterViewModel {
                Id = _cm.Id.ToString(), VillageName = _cm.VillageName
            });
        }
        /// <inheritdoc />
        public async Task <int> RetrieveAsync()
        {
            int result = await _repository.GetAsync();

            return(result);
        }