public async Task <IActionResult> Index()
        {
            CoursesCounterResponse response = await _finder.Find();

            return(Ok(new Dictionary <string, int>()
            {
                { "total", response.Total }
            }));
        }
Ejemplo n.º 2
0
        public async Task it_should_find_an_existing_courses_counter()
        {
            CoursesCounter         counter  = CoursesCounterMother.Random();
            CoursesCounterResponse response = CoursesCounterResponseMother.Create(counter.Total.Value);

            ShouldSearch(counter);

            Assert.Equal(response, await _finder.Find());
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Index()
        {
            CoursesCounterResponse response = await _bus.Ask <CoursesCounterResponse>(new FindCoursesCounterQuery());

            return(Ok(new Dictionary <string, int>()
            {
                { "total", response.Total }
            }));
        }
Ejemplo n.º 4
0
        public async Task it_should_find_an_existing_courses_counter()
        {
            CoursesCounter          counter = CoursesCounterMother.Random();
            FindCoursesCounterQuery query   = new FindCoursesCounterQuery();

            CoursesCounterResponse response = CoursesCounterResponseMother.Create(counter.Total.Value);

            ShouldSearch(counter);

            Assert.Equal(response, await _handler.Handle(query));
        }