public async Task GivenAnEvaluation_WhenCreateAsync_ThenReturnEvaluationEntity()
        {
            var evaluation = EvaluationsFactory.ValidEvaluation();

            var result = await _repository.CreateAsync(evaluation);

            result.Should().BeOfType <Evaluation>();
            result.Scor.Should().Be(evaluation.Scor);
            result.UserId.Should().Be(evaluation.UserId);
            result.ConsultantId.Should().Be(evaluation.ConsultantId);
        }
예제 #2
0
        public async Task CreateAsync(EvaluationDTO entity)
        {
            Evaluation dbEntity = new Evaluation()
            {
                Id        = entity.Id,
                Mark      = entity.Mark,
                Day       = entity.Day,
                SubjectId = entity.SubjectId,
                TeacherId = entity.TeacherId,
                ClassId   = entity.ClassId
            };

            await _evaluationRepository.CreateAsync(dbEntity);
        }
예제 #3
0
        public async Task <Evaluation> Handle(CreateEvaluationCommand request, CancellationToken cancellationToken)
        {
            var user = _mapper.Map <Evaluation>(request);

            return(await _repository.CreateAsync(user));
        }