public void Test_EvaluationRepository_GetAll_ShouldBeOk()
        {
            int expectedAmount            = 4;
            List <Evaluation> evaluations = _repository.GetAll().ToList();

            evaluations.Should().NotBeNullOrEmpty();
            evaluations.Count.Should().Be(expectedAmount);
        }
예제 #2
0
        public IList <Evaluation> GetAll()
        {
            IList <Evaluation> evaluations = _evaluationRepository.GetAll();

            foreach (var evaluation in evaluations)
            {
                evaluation.Results = _resultRepository.GetByEvaluation(evaluation.Id).ToList();
            }
            return(evaluations);
        }
        public async Task <DataResponse <Evaluation> > GetAll()
        {
            DataResponse <Evaluation> response = new DataResponse <Evaluation>();

            try
            {
                response = await _repository.GetAll();

                return(response);
            }
            catch (Exception e)
            {
                StringBuilder sb = new StringBuilder();
                log.Error(sb.AppendLine(e.Message).AppendLine(e.StackTrace).ToString());
                response.Success = false;
                response.ErrorList.Add("Erro inesperado");
                return(response);
            }
        }
 public IEnumerable <Evaluation> All()
 {
     return(_evaluationRepository.GetAll());
 }