Cleanup diff by reorder
This commit is contained in:
Родитель
3af7e8b17b
Коммит
2478b73f52
|
@ -464,27 +464,6 @@ namespace Microsoft.Extensions.Configuration.Binder.Test
|
|||
Assert.Equal("Derived:Sup", options.Virtual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CanGetComplexOptionsWhichHasAlsoHasValue()
|
||||
{
|
||||
var dic = new Dictionary<string, string>
|
||||
{
|
||||
{"obj", "whut" },
|
||||
{"obj:Integer", "-2"},
|
||||
{"obj:Boolean", "TRUe"},
|
||||
{"obj:Nested:Integer", "11"}
|
||||
};
|
||||
var configurationBuilder = new ConfigurationBuilder();
|
||||
configurationBuilder.AddInMemoryCollection(dic);
|
||||
var config = configurationBuilder.Build();
|
||||
|
||||
var options = config.GetSection("obj").Get<ComplexOptions>();
|
||||
Assert.NotNull(options);
|
||||
Assert.True(options.Boolean);
|
||||
Assert.Equal(-2, options.Integer);
|
||||
Assert.Equal(11, options.Nested.Integer);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetCanReadStaticProperty()
|
||||
{
|
||||
|
@ -518,6 +497,27 @@ namespace Microsoft.Extensions.Configuration.Binder.Test
|
|||
Assert.Equal("other stuff", ComplexOptions.StaticProperty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CanGetComplexOptionsWhichHasAlsoHasValue()
|
||||
{
|
||||
var dic = new Dictionary<string, string>
|
||||
{
|
||||
{"obj", "whut" },
|
||||
{"obj:Integer", "-2"},
|
||||
{"obj:Boolean", "TRUe"},
|
||||
{"obj:Nested:Integer", "11"}
|
||||
};
|
||||
var configurationBuilder = new ConfigurationBuilder();
|
||||
configurationBuilder.AddInMemoryCollection(dic);
|
||||
var config = configurationBuilder.Build();
|
||||
|
||||
var options = config.GetSection("obj").Get<ComplexOptions>();
|
||||
Assert.NotNull(options);
|
||||
Assert.True(options.Boolean);
|
||||
Assert.Equal(-2, options.Integer);
|
||||
Assert.Equal(11, options.Nested.Integer);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("ReadOnly")]
|
||||
[InlineData("PrivateSetter")]
|
||||
|
|
Загрузка…
Ссылка в новой задаче