Exemplo n.º 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();
        }
        public When_Placement_Information_Loaded_With_Placements_Unknown()
        {
            _dto.OpportunityId   = OpportunityId;
            _dto.PlacementsKnown = PlacementsKnown;
            _dto.Placements      = Placements;

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

            var opportunityService = Substitute.For <IOpportunityService>();

            opportunityService.GetPlacementInformationAsync(Arg.Any <int>()).Returns(_dto);

            var opportunityController = new OpportunityController(opportunityService, mapper);

            _result = opportunityController.GetPlacementInformationAsync(OpportunityItemId).GetAwaiter().GetResult();
        }