Example #1
0
        public async Task Handle_QuadraHandler_RetornarListaComTodasQuadrasDoSistema()
        {
            var query = new ObterQuadrasQuery {
            };

            var quadrasResult = await _mediator.Send(query);

            quadrasResult.Should().HaveCount(3);
        }
Example #2
0
        public async Task <IReadOnlyList <QuadraModel> > ObterQuadrasAsync(PaginacaoQuery pagination = null)
        {
            var obterQuadrasQuery = new ObterQuadrasQuery {
            };

            var quadras = await _mediator
                          .Send(obterQuadrasQuery);

            var skip = (pagination.NumeroPagina - 1) * pagination.QuantidadePagina;

            return(quadras
                   .Skip(skip)
                   .Take(pagination.QuantidadePagina)
                   .ToList());
        }
Example #3
0
 public async Task <IReadOnlyList <QuadraModel> > Handle(ObterQuadrasQuery request, CancellationToken cancellationToken)
 {
     return(await _quadraServico.ObterQuadrasAsync());
 }