예제 #1
0
        public TestOptionApi() : base()
        {
            //Create 2 parents option and 6 childrens option
            var specs = new List <HrbcOptionCreator.Spec>
            {
                new HrbcOptionCreator.Spec {
                    Name = "My Options 1", ParentId = 0, Key = 0, Children = new List <HrbcOptionCreator.Spec>
                    {
                        new HrbcOptionCreator.Spec {
                            Name = "Option1", Sort = 1, Children = new List <HrbcOptionCreator.Spec>
                            {
                                new HrbcOptionCreator.Spec {
                                    Name = "Option1.1", Sort = 1, Children = new List <HrbcOptionCreator.Spec> {
                                        new HrbcOptionCreator.Spec {
                                            Name = "Option1.1.1", Sort = 1, Key = 4
                                        }
                                    }, Key = 3
                                }
                            }, Key = 1
                        },
                    }
                },
                new HrbcOptionCreator.Spec {
                    Name = "My Options 2", ParentId = 0, Key = 5, Children = new List <HrbcOptionCreator.Spec>
                    {
                        new HrbcOptionCreator.Spec {
                            Name = "Option2", Sort = 1, Children = new List <HrbcOptionCreator.Spec>
                            {
                                new HrbcOptionCreator.Spec {
                                    Name = "Option2.1", Sort = 1, Children = new List <HrbcOptionCreator.Spec> {
                                        new HrbcOptionCreator.Spec {
                                            Name = "Option2.1.1", Sort = 1, Key = 8
                                        }
                                    }, Key = 7
                                }
                            }, Key = 6
                        },
                    }
                }
            };

            options = new HrbcOptionCreator(() => specs);
        }
예제 #2
0
        private void PrepareOptions()
        {
            var phaseOptionsData = new List <HrbcOptionCreator.Spec>();

            foreach (var map in PhaseOptionAliasToIdMapping)
            {
                for (var i = 0; i < PhaseOptionsCount; i++)
                {
                    phaseOptionsData.Add(new HrbcOptionCreator.Spec
                    {
                        Name        = $"OptionField_{i}",
                        Type        = map.Value,
                        ParentAlias = map.Key,

                        Key = $"Option_childOf:{map.Key}_number:{i}"
                    });
                }
            }
            options = new HrbcOptionCreator(() => phaseOptionsData);
        }
 public TestWriteOtherValidInput() : base()
 {
     options          = new HrbcOptionCreator(() => PhaseFieldHelper.InitOptionCreator(phaseList, NumberOfOptions)); // 3 options - Greater and smaller parent case, the current chosen is the 2nd option.
     recordUpdater    = new HrbcRecordUpdater(() => PhaseFieldHelper.InitRecordsUpdater(records, phaseSearcher));
     phaseEntryReader = new HrbcPhaseEntryReader(() => PhaseFieldHelper.InitPhaseEntryReader(records));
 }