public IList <LotteryPlanGroupDto> GetUserLotteryPlans(string userId, LotteryType lotteryType) { var lotteryPlanGroupDtos = new List <LotteryPlanGroupDto>(); var selectedPlanGroup = new LotteryPlanGroupDto() { LotteryType = lotteryType.ToString(), GroupId = 0, GroupName = "已选计划", IsSelecedGroup = true, Plans = new List <PlanOutput>(), }; lotteryPlanGroupDtos.Add(selectedPlanGroup); var lotteryFeature = _lotteryFeatureLoader.LoadLotteryFeature(lotteryType); var userSelectedPlans = _anylseNormAppService.GetUserSelectedPlans(userId, lotteryType); foreach (var normGroup in lotteryFeature.LotteryNorm.NormGroup) { var planGroupDto = new LotteryPlanGroupDto() { LotteryType = lotteryType.ToString(), GroupId = normGroup.GroupId, GroupName = normGroup.Cname, IsSelecedGroup = false, Plans = new List <PlanOutput>(), }; foreach (var plan in normGroup.Plans) { var planDto = new PlanOutput() { PlanId = plan.PlanId, PlanName = plan.Name, IsSelected = false }; if (userSelectedPlans.Contains(planDto.PlanId)) { planDto.IsSelected = true; selectedPlanGroup.Plans.Add(planDto); } planGroupDto.Plans.Add(planDto); } lotteryPlanGroupDtos.Add(planGroupDto); } return(lotteryPlanGroupDtos); }
public PlanFixture() { _rawPlanOutput = File.ReadAllText($"{Environment.CurrentDirectory}\\Data\\plan.json"); _planOutput = JsonSerializer.Deserialize <PlanOutput>(_rawPlanOutput, DefaultJsonSettings.Settings); }
public TerraformPlanOutputUnitTest(PlanFixture planFixture) { _planFixture = planFixture; _planOutput = planFixture.GetPlanOutput(); }