public async Task <IActionResult> GetAll() { var counters = await counterRepository.GetAll(); var result = mapper.Map <IEnumerable <ViewCounterResource> >(counters); return(Ok(result)); }
public async Task GetAllCounters() { var counters = new List <Counter> { new Counter { Name = "counter1" }, new Counter { Name = "counter2" }, }; A.CallTo(() => _repo.GetAll()).Returns(counters); var result = await _subject.GetAllCounters(); result.ShouldBeSameAs(counters); }
public Task <List <Counter> > GetAllCounters() { return(_repository.GetAll()); }