Exemplo n.º 1
0
        public async Task GetEmployeesListTest()
        {
            var handler = new GetEmployeesListQueryHandler(_mapper, _mockEmployeeRepository.Object);
            var result  = await handler.Handle(new GetEmployeesListQuery(), CancellationToken.None);

            result.ShouldNotBeEmpty();
            result.ShouldNotBeOfType <IEnumerable <EmployeeRest> >();
            result.Count().ShouldBe(9);
        }
Exemplo n.º 2
0
        public async Task HandleQuery_ReturnsCorrectVmAndCount()
        {
            var query   = new GetEmployeesListQuery();
            var handler = new GetEmployeesListQueryHandler(_context, _mapper);

            var result = await handler.Handle(query, CancellationToken.None);

            result.ShouldBeOfType <EmployeesListVm>();
            result.Employees.Count.ShouldBe(5);
        }
        public async Task GetEmployeesListTest()
        {
            var handler = new GetEmployeesListQueryHandler(_mapper, _mockEmployeeRepository.Object);

            var result = await handler.Handle(new GetEmployeesListQuery(), CancellationToken.None);

            result.ShouldBeOfType <List <EmployeeListVm> >();

            result.Count.ShouldBe(4);
        }