public async Task ShouldBeAbleToCreateInterviewFromTemplate() { var dbInterviewTemplate = await Arranger.CreateInterviewTemplate(); var requestInterview = Stubber.StubInterviewDto(); var responseInterview = await ApiClient.PostInterview(requestInterview, dbInterviewTemplate.Id) .AwaitGetSuccessfulResponse <InterviewDto>(); var dbInterviewTemplateDto = Mapper.Map <IEnumerable <QuestionDto> >(dbInterviewTemplate.Questions); Assert.IsTrue(responseInterview.Questions.CompareCollectionsUsingLikeness(dbInterviewTemplateDto)); }
public async Task ShouldBeAbleToGetAnInterviewTemplate() { var dbInterviewTemplate = await Arranger.CreateInterviewTemplate(); var responseInterviewTemplate = await ApiClient.GetInterviewTemplate(dbInterviewTemplate.Id) .AwaitGetSuccessfulResponse <InterviewTemplateDto>(); var dbInterviewTemplateDto = Mapper.Map <InterviewTemplateDto>(dbInterviewTemplate); responseInterviewTemplate .ToLikeness(true) .WithCollectionSequenceEquals(o => o.QuestionIds) .ShouldEqual(dbInterviewTemplateDto); }
public async Task ShouldBeAbleToPatchAnInterviewTemplate() { var interviewTemplateDto = Mapper.Map <InterviewTemplateDto>(await Arranger.CreateInterviewTemplate()); var patchRequest = Stubber.StubInterviewTemplatePatchRequest(); patchRequest.ApplyTo(interviewTemplateDto); (await ApiClient.PatchInterviewTemplate(interviewTemplateDto.Id, patchRequest)) .EnsureSuccessStatusCode(); var updatedInterviewTemplateDto = Mapper.Map <InterviewTemplateDto>( await Arranger.GetInterviewTemplate(interviewTemplateDto.Id)); interviewTemplateDto .ToLikeness() .Without(o => o.QuestionIds) .ShouldEqual(updatedInterviewTemplateDto); }