Ejemplo n.º 1
0
        public async Task ShouldBeAbleToGetAllQuestions()
        {
            var dbQuestions = await Arranger.CreateQuestions();

            var responseQuestionDtos = await ApiClient.GetAllQuestions()
                                       .AwaitGetSuccessfulResponse <IEnumerable <QuestionDto> >();

            var responseQuestions = Mapper.Map <IEnumerable <Question> >(responseQuestionDtos);

            responseQuestions = Enumerable.Where <Question>(responseQuestions, rq => dbQuestions.Any(dq => dq.Id == rq.Id));

            Assert.IsTrue(LikenessCompareExtensions.CompareCollectionsUsingLikeness <Question, Question>(responseQuestions, dbQuestions));
        }
Ejemplo n.º 2
0
        public async Task ShouldBeAbleToCreateAnInterviewTemplateWithQuestions()
        {
            var requestInterviewTemplate = Stubber.StubInterviewTemplateDto();

            var questions = await Arranger.CreateQuestions();

            requestInterviewTemplate.QuestionIds = questions.Select(q => q.Id);

            var responseInterviewTemplate = await ApiClient.PostInterviewTemplate(requestInterviewTemplate)
                                            .AwaitGetSuccessfulResponse <InterviewTemplateDto>();

            responseInterviewTemplate
            .ToLikeness()
            .WithCollectionSequenceEquals(o => o.QuestionIds)
            .ShouldEqual(requestInterviewTemplate);
        }