示例#1
0
        public When_Placement_Information_Loaded()
        {
            var dto = new PlacementInformationSaveDto
            {
                OpportunityId       = OpportunityId,
                OpportunityItemId   = OpportunityItemId,
                JobRole             = JobRole,
                OpportunityType     = OpportunityType.Referral,
                CompanyName         = CompanyName,
                CompanyNameAka      = CompanyNameAka,
                PlacementsKnown     = PlacementsKnown,
                Placements          = Placements,
                NoSuitableStudent   = true,
                HadBadExperience    = true,
                ProvidersTooFarAway = true
            };

            var config = new MapperConfiguration(c => c.AddMaps(typeof(PlacementInformationSaveDtoMapper).Assembly));
            var mapper = new Mapper(config);

            _opportunityService = Substitute.For <IOpportunityService>();
            _opportunityService.GetPlacementInformationAsync(OpportunityItemId).Returns(dto);

            var opportunityController = new OpportunityController(_opportunityService, mapper);

            _result = opportunityController.GetPlacementInformationAsync(OpportunityItemId).GetAwaiter().GetResult();
        }
示例#2
0
        public async Task <IActionResult> GetPlacementInformationAsync(int opportunityItemId)
        {
            var dto = await _opportunityService.GetPlacementInformationAsync(opportunityItemId);

            var viewModel = _mapper.Map <PlacementInformationSaveViewModel>(dto);

            return(View("PlacementInformation", viewModel));
        }