public void MapToWizardQuestionDto_QuestionWithWrittenAnswers_ValidDto() { //arrange var expectedDto = new Dtos.Wizard.QuestionWithWrittenAnswerDto { Id = questionWithWrittenAnswer.Id, Answer = ((WrittenAnswer)questionWithWrittenAnswer.Answer).Value, Question = questionWithWrittenAnswer.Content, Score = questionWithWrittenAnswer.Answer.MaxScore, Categories = new List <int>() }; //act var mapper = new QuestionServiceMapper(); var dto = mapper.MapToWizardQuestionDto(questionWithWrittenAnswer); //assert dto.Should().BeEquivalentTo(expectedDto); }
public void MapToAnswer_QuestionWithWritenAnswerDto_ValidAnswer() { //arrange var answerValue = "answer content"; var score = 5f; Dtos.Wizard.QuestionDto dto = new Dtos.Wizard.QuestionWithWrittenAnswerDto { Id = 1, Answer = answerValue, Categories = new List <int>(), Question = "Question content", Score = score }; var expectedAnswer = new WrittenAnswer(answerValue, score); //act var mapper = new QuestionServiceMapper(); var answer = mapper.MapToAnswer(dto); //assert answer.Should().BeEquivalentTo(expectedAnswer); }