Exemplo n.º 1
0
        public async Task it_should_throw_an_exception_when_courses_counter_does_not_exists()
        {
            var query = new FindCoursesCounterQuery();

            ShouldSearch();

            await Assert.ThrowsAsync <CoursesCounterNotInitialized>(async() => await _handler.Handle(query));
        }
Exemplo n.º 2
0
        public async Task it_should_find_an_existing_courses_counter()
        {
            var counter = CoursesCounterMother.Random();
            var query   = new FindCoursesCounterQuery();

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

            ShouldSearch(counter);

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