public void TryGetConfigurationOptions_SimpleConfiguration_OptionsReturned() { var factory = new DynamicDataAdapterConfigurationFactory(); var options = factory.TryGetConfigurationOptions(typeof(ISimpleConfiguration)); Assert.IsNotNull(options, TestResources.NullOptionsReturned); Assert.AreEqual(2, options.Count, TestResources.InvalidNumberOfOptions); Assert.IsTrue(options.Any(o => o.Key == "Property1"), TestResources.ConfigurationOptionMissingFormat, "Property1"); Assert.IsTrue(options.Any(o => o.Key == "Property2"), TestResources.ConfigurationOptionMissingFormat, "Property2"); }
public void TryGetConfigurationOptions_CustomDescription_DescriptionReturned() { var factory = new DynamicDataAdapterConfigurationFactory(); var options = factory.TryGetConfigurationOptions(typeof(ICustomDescriptionConfiguration)); Assert.IsNotNull(options, TestResources.NullOptionsReturned); Assert.AreEqual(2, options.Count, TestResources.InvalidNumberOfOptions); Assert.IsTrue(options.Any(o => o.Key == "PropA"), TestResources.ConfigurationOptionMissingFormat, "PropA"); Assert.IsTrue(options.Any(o => o.Key == "PropB"), TestResources.ConfigurationOptionMissingFormat, "PropB"); Assert.AreEqual("Hello", options["PropA"], TestResources.InvalidConfigurationOptionDescriptionFormat, "PropA"); Assert.AreEqual("World!", options["PropB"], TestResources.InvalidConfigurationOptionDescriptionFormat, "PropB"); }