public void Options_Georegions_ShouldContainAllSubRegionsForAsia(string region, IEnumerable <string> expectedSubRegions) { var options = new ExperienceGeneratorActionsController().Options(); var acualSubRegions = options.LocationGroups.Single(x => x.Label == region).Options.Select(x => x.Label); foreach (var expectedSubRegion in expectedSubRegions) { acualSubRegions.Should().Contain(expectedSubRegion); } }
public void Options_OutcomesWithGroup_ShouldReturnSingleOutcomeGroup(Db db, [NoAutoProperties] ExperienceGeneratorActionsController controller) { var outcomeGroup = db.GetItem(KnownItems.TaxonomyRoot).Add("OutcomeGroup", new TemplateID(OutcomegroupItem.TemplateID)); var item = db.GetItem(KnownItems.OutcomesRoot); var outcome = item.Add("SampleOutcome", new TemplateID(OutcomeDefinitionItem.TemplateID)); using (new EditContext(outcome)) { outcome["Group"] = outcomeGroup.ID.ToString(); } var options = controller.Options(); options.OutcomeGroups.Count.Should().Be(1); options.OutcomeGroups.First().Label.Should().Be("OutcomeGroup"); options.OutcomeGroups.First().Options.Count().Should().Be(1); options.OutcomeGroups.First().Options.First().Id.Should().Be(outcome.ID.ToString()); }
public void Options_OutcomesWithoutGroup_ShouldReturnSingleOutcomeGroup(Db db, [NoAutoProperties] ExperienceGeneratorActionsController controller) { var item = db.GetItem(KnownItems.OutcomesRoot); var outcome = item.Add("SampleOutcome", new TemplateID(OutcomeDefinitionItem.TemplateID)); var options = controller.Options(); options.OutcomeGroups.Count.Should().Be(1); options.OutcomeGroups.First().Options.Count().Should().Be(1); options.OutcomeGroups.First().Label.Should().Be("None"); }