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)); }
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); }