Ejemplo n.º 1
0
        public async Task ShouldBeAbleToGetAQuestion()
        {
            var dbQuestion = await Arranger.CreateQuestion();

            var responseQuestionDto = await ApiClient.GetQuestion(dbQuestion.Id)
                                      .AwaitGetSuccessfulResponse <QuestionDto>();

            responseQuestionDto.ToLikeness(true).ShouldEqual(Mapper.Map <QuestionDto>(dbQuestion));
        }
Ejemplo n.º 2
0
        public async Task ShouldBeABleToUpdateQuestion()
        {
            var questionDto = Mapper.Map <QuestionDto>(await Arranger.CreateQuestion());

            var questionPatchRequest = Stubber.StubQuestionPatchRequest();

            questionPatchRequest.ApplyTo(questionDto);

            await ApiClient.PatchQuestion(questionDto.Id, questionPatchRequest);

            var updatedQuestionDto = Mapper.Map <QuestionDto>(await Arranger.GetQuestion(questionDto.Id));

            questionDto.ToLikeness(true).ShouldEqual(updatedQuestionDto);
        }