コード例 #1
0
        public async Task <IActionResult> GetAll()
        {
            var counters = await counterRepository.GetAll();

            var result = mapper.Map <IEnumerable <ViewCounterResource> >(counters);

            return(Ok(result));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public Task <List <Counter> > GetAllCounters()
 {
     return(_repository.GetAll());
 }