本文整理汇总了C#中Configuration.GetConfiguration方法的典型用法代码示例。如果您正苦于以下问题:C# Configuration.GetConfiguration方法的具体用法?C# Configuration.GetConfiguration怎么用?C# Configuration.GetConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration
的用法示例。
在下文中一共展示了Configuration.GetConfiguration方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: can_get_script_from_stream
public void can_get_script_from_stream()
{
var config = new Configuration<ITestConfiguration>();
var c = config.GetConfiguration("Embedded",
Assembly.GetExecutingAssembly().GetManifestResourceStream(
"Test.ConfigInCode.Embedded.rb"), "UnusedParam");
Assert.NotNull(c);
}
示例2: ShouldLoadFromContainer
public void ShouldLoadFromContainer()
{
ObjectFactory.Initialize(x =>
x.For<ITestConfiguration>().Use(context =>
{
var config = new Configuration<ITestConfiguration>();
return config.GetConfiguration("Configuration", "UnusedParam");
}));
var result = ObjectFactory.GetInstance<ITestConfiguration>();
Assert.That(result, Is.Not.Null);
}
示例3: can_respond_to_method_call_ruby
public void can_respond_to_method_call_ruby()
{
var config = new Configuration<IRespond>();
var c = config.GetConfiguration("RubyResponder");
Assert.That(c.Request(), Is.EqualTo("Hello World"));
}
示例4: can_pass_in_constructor_ruby
public void can_pass_in_constructor_ruby()
{
var config = new Configuration<ITestConfiguration>();
var c = config.GetConfiguration("Configuration", "HelloWorld");
Assert.AreEqual("HelloWorld", c.ConstructorValue);
}
示例5: can_pass_in_constructor_python
public void can_pass_in_constructor_python()
{
var config = new Configuration<ITestPython>();
var c = config.GetConfiguration("TestPythonWithConst", "HelloWorld");
Assert.AreEqual("HelloWorld", c.ConstructorValue);
}
示例6: can_load_ruby_config_file
public void can_load_ruby_config_file()
{
var config = new Configuration<ITestConfiguration>();
var c = config.GetConfiguration("Configuration", "UnusedParam");
Assert.NotNull(c);
}