Exemplo n.º 1
0
        public async Task <ProducerData[]> HandleAsync(GetProducerReport message)
        {
            var user = await internalUserRepository.GetByUserId(userContext.UserId);

            return
                ((await
                  repository.GetProducerReport(message.DateType, message.From, message.To, message.TextFieldType,
                                               message.OperatorType, message.TextSearch, user.CompetentAuthority)).ToArray());
        }
        public async Task GetProducerReportHandler_HandleAsync_GetProducerReport()
        {
            var request = GetRequest();

            await handler.HandleAsync(request);

            A.CallTo(
                () =>
                repository.GetProducerReport(request.DateType, request.From, request.To, request.TextFieldType,
                                             request.OperatorType, request.TextSearch, competentAuthority))
            .MustHaveHappened(Repeated.Exactly.Once);
        }