public void SR_HAPAG_CONDITION() { var context = new ContextHolder { UserProfiles = new SortedSet <int?> { 3 }, ApplicationLookupContext = new ApplicationLookupContext { Schema = "list" } }; var result = ConfigurationService.BuildResultValues <string>(_values, context); Assert.AreEqual("5", result.First().Value.Value); context = new ContextHolder { UserProfiles = new SortedSet <int?> { 3 }, ApplicationLookupContext = new ApplicationLookupContext { Schema = "detail" } }; result = ConfigurationService.BuildResultValues <string>(_values, context); Assert.AreEqual("7", result.First().Value.Value); context = new ContextHolder { UserProfiles = new SortedSet <int?> { 3 }, }; result = ConfigurationService.BuildResultValues <string>(_values, context); Assert.AreEqual("5", result.First().Value.Value); }
public void AskAndDoNotFind() { var context = new ContextHolder(); var result = ConfigurationService.BuildResultValues <string>(_list2NoDefault, context); Assert.IsFalse(result.Any()); }
public void ModuleAskTest() { var context = new ContextHolder { Module = "xitc", }; var result = ConfigurationService.BuildResultValues <string>(_values, context); Assert.AreEqual("2", result.First().Value.Value); }
public void ModuleAskTest2() { var context = new ContextHolder { Module = "xitc", UserProfiles = new SortedSet <int?> { 2 }, }; var result = ConfigurationService.BuildResultValues <string>(_list1ProfileNoModule, context); Assert.IsFalse(result.Any()); }
public void AskForSchemaWithProfile2() { var context = new ContextHolder { UserProfiles = new SortedSet <int?> { 4 }, ApplicationLookupContext = new ApplicationLookupContext { Schema = "detail" } }; var result = ConfigurationService.BuildResultValues <string>(_values3, context); Assert.AreEqual("8", result.First().Value.Value); }
public void MetadataAskTest2() { var context = new ContextHolder { UserProfiles = new SortedSet <int?> { 2 }, ApplicationLookupContext = new ApplicationLookupContext { MetadataId = "zzz" }, SiteId = "site" }; var result = ConfigurationService.BuildResultValues <string>(_values, context); Assert.AreEqual("9", result.First().Value.Value); }
public void _2ConditionsOneWithModuleAnotherWithout_returnDefault() { var context = new ContextHolder(); IEnumerable <PropertyValue> values = new List <PropertyValue> { new PropertyValue { Value = "1" }, new PropertyValue { Value = "2", Module = "xxx" } }; var result = ConfigurationService.BuildResultValues <string>(values, context); Assert.AreEqual("1", result.First().Value.Value); }
public void AskForModule_DoNotConsiderDefault() { var context = new ContextHolder { Module = "yyy" }; IEnumerable <PropertyValue> values = new List <PropertyValue> { new PropertyValue { Value = "1" }, new PropertyValue { Value = "2", Module = "xxx" } }; var result = ConfigurationService.BuildResultValues <string>(values, context); Assert.IsFalse(result.Any()); }
public void ModuleAskTestCombination() { IEnumerable <PropertyValue> allModulesTest = new List <PropertyValue> { new PropertyValue { Value = "2", Module = Conditions.AnyCondition }, new PropertyValue { Value = "3", Module = "purchase" }, new PropertyValue { Value = "4", Module = "sso,tui" }, }; var context = new ContextHolder { Module = "xitc", }; var result = ConfigurationService.BuildResultValues <string>(allModulesTest, context); Assert.AreEqual("2", result.First().Value.Value); context = new ContextHolder { Module = "purchase", }; result = ConfigurationService.BuildResultValues <string>(allModulesTest, context); Assert.AreEqual("3", result.First().Value.Value); context = new ContextHolder { Module = "sso", }; result = ConfigurationService.BuildResultValues <string>(allModulesTest, context); Assert.AreEqual("4", result.First().Value.Value); context = new ContextHolder { Module = null, }; result = ConfigurationService.BuildResultValues <string>(allModulesTest, context); Assert.AreEqual("2", result.First().Value.Value); }