public When_Recording_Referrals_And_Check_Answers_Is_Loaded() { var config = new MapperConfiguration(c => c.AddMaps(typeof(CheckAnswersDtoMapper).Assembly)); var mapper = new Mapper(config); var dto = new ValidCheckAnswersDtoBuilder().Build(); _opportunityService = Substitute.For <IOpportunityService>(); _opportunityService.GetCheckAnswersAsync(OpportunityItemId).Returns(dto); var opportunityController = new OpportunityController(_opportunityService, mapper); var controllerWithClaims = new ClaimsBuilder <OpportunityController>(opportunityController) .AddUserName(CreatedBy) .Build(); _result = controllerWithClaims.GetCheckAnswersAsync(OpportunityItemId).GetAwaiter().GetResult(); }