public ConfigurationValidatorTests()
 {
     modelBuilder   = new ConfigurationModelBuilder <SampleConfig, SampleConfigSet>(nameof(SampleConfigSet.SampleConfig), c => c.SampleConfig);
     configIdentity = new ConfigurationIdentity(new ConfigurationClient("TestId"), new Version(1, 0));
     service        = new Mock <IConfigurationSetService>();
     service.Setup(r => r.GetConfigurationSet(typeof(SampleConfigSet), It.IsAny <ConfigurationIdentity>()))
     .ReturnsAsync(() => new SampleConfigSet {
         Options = new OptionSet <OptionFromConfigSet>(OptionFromConfigSet.Options, o => o.Id.ToString(), o => o.Description)
     });
     target = new ConfigurationValidator(new TestOptionSetFactory(), service.Object);
 }
示例#2
0
 public ConfigurationFloatPropertyBuilderTests()
 {
     target = new ConfigurationModelBuilder <FloatTestClass>(new ConfigurationModel(nameof(SimpleConfig), typeof(SimpleConfig)));
 }
示例#3
0
 public ConfigurationModelBuilderTest()
 {
     target = new ConfigurationModelBuilder <SimpleConfig, SimpleConfigSet>(new ConfigurationModel <SimpleConfig, SimpleConfigSet>(nameof(SimpleConfigSet.Config), c => c.Config, (set, c) => set.Config = c));
 }
示例#4
0
 public ConfigurationIntergerPropertyDefinitionTests()
 {
     target = new ConfigurationModelBuilder <IntergerTestClass>(new ConfigurationModel(nameof(SimpleConfig), typeof(SimpleConfig)));
 }
示例#5
0
 public ConfigurationPropertyWithOptionFromConfigurationSetBuilderTests()
 {
     target         = new ConfigurationModelBuilder <TestConfig, TestConfiguationModule>(new ConfigurationModel <TestConfig, TestConfiguationModule>(nameof(TestConfiguationModule.TestConfig), c => c.TestConfig, (set, c) => set.TestConfig = c));
     configIdentity = new ConfigurationIdentity(new ConfigurationClient("TestId"), new Version(1, 0));
 }
 public ConfigurationDateTimePropertyBuilderTests()
 {
     target = new ConfigurationModelBuilder <DateTimeTestClass, TestConfigSet>(new ConfigurationModel <DateTimeTestClass, TestConfigSet>(nameof(TestConfigSet.DateTime), c => c.DateTime, (set, c) => set.DateTime = c));
 }
示例#7
0
 public ConfigurationClassPropertyBuilderTests()
 {
     target = new ConfigurationModelBuilder <ParentTestClass, TestConfigSet>(new ConfigurationModel <ParentTestClass, TestConfigSet>(nameof(TestConfigSet.ParentClass), c => c.ParentClass, (set, c) => set.ParentClass = c));
 }
 public ConfigurationPropertyWithOptionBuilderTests()
 {
     target = new ConfigurationModelBuilder <PropertyWithOptionTestClass>(new ConfigurationModel(nameof(PropertyWithOptionTestClass), typeof(PropertyWithOptionTestClass)));
     mockServiceProvider = new Mock <IServiceProvider>();
     mockServiceProvider.Setup(p => p.GetService(typeof(OptionProvider))).Returns(() => new OptionProvider());
 }
示例#9
0
 public ConfigurationModelBuilderTest()
 {
     target = new ConfigurationModelBuilder <SimpleConfig>(new ConfigurationModel(nameof(SimpleConfig), typeof(SimpleConfig)));
 }
 public ConfigurationFloatPropertyBuilderTests()
 {
     target = new ConfigurationModelBuilder <FloatTestClass, TestConfigSet>(new ConfigurationModel <FloatTestClass, TestConfigSet>(nameof(TestConfigSet.Float), c => c.Float, (set, c) => set.Float = c));
 }
示例#11
0
 public ConfigurationDateTimePropertyBuilderTests()
 {
     target = new ConfigurationModelBuilder <DateTimeTestClass>(new ConfigurationModel(nameof(SimpleConfig), typeof(SimpleConfig)));
 }
 public ConfigurationStringPropertyBuilderTests()
 {
     target = new ConfigurationModelBuilder <StringTestClass>(new ConfigurationModel(nameof(StringTestClass), typeof(StringTestClass)));
 }
示例#13
0
 public ConfigurationStringPropertyBuilderTests()
 {
     target = new ConfigurationModelBuilder <StringTestClass, TestConfigSet>(new ConfigurationModel <StringTestClass, TestConfigSet>(nameof(TestConfigSet.String), c => c.String, (set, c) => set.String = c));
 }
示例#14
0
 public ConfigurationValidatorTests()
 {
     modelBuilder = new ConfigurationModelBuilder <SampleConfig>(nameof(SampleConfig));
     target       = new ConfigurationValidator(new TestOptionSetFactory());
 }
示例#15
0
 public ConfigurationIntergerPropertyDefinitionTests()
 {
     target = new ConfigurationModelBuilder <IntergerTestClass, TestConfigSet>(new ConfigurationModel <IntergerTestClass, TestConfigSet>(nameof(TestConfigSet.Integer), p => p.Integer, (set, c) => set.Integer = c));
 }