-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
[Fact]
public void Test1()
{
#pragma warning disable
string jsonA = """
{
"Defaults": [
{
"Scope": "posts",
"Path": "",
"Extensions": [ ".html" ],
"Values": {
"NotOverride": "Original",
"Override": "Original",
}
}
]
}
""";
using MemoryStream streamA = new MemoryStream(Encoding.UTF8.GetBytes(jsonA));
string jsonB = """
{
"Defaults": [
{
"Scope": "posts",
"Path": "",
"Extensions": [ ".html" ],
"Values": {
"Override": "Override",
"New": "New"
}
}
]
}
""";
using MemoryStream streamB = new MemoryStream(Encoding.UTF8.GetBytes(jsonB));
IConfiguration config = new ConfigurationBuilder()
.AddJsonStream(streamA)
.AddJsonStream(streamB)
.Build();
// DefaultMetadatas
DefaultMetadatas x = config.GetSection("Defaults").Get<DefaultMetadatas>();
x[0].Values["NotOverride"].Should().Be("Original");
x[0].Values["Override"].Should().Be("Override");
x[0].Values["New"].Should().Be("New");
#pragma warning restore
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels