Fix runtime graph reader

This commit is contained in:
Pavel Krymets 2016-03-15 12:51:43 -07:00
parent 2ce679c57d
commit a76558f560
2 changed files with 4 additions and 8 deletions

View file

@ -86,9 +86,7 @@ namespace Microsoft.Extensions.DependencyModel
yield break;
}
var targets = runtimes.Children();
var runtime = (JProperty)targets.Single();
foreach (var pair in (JObject)runtime.Value)
foreach (var pair in runtimes)
{
yield return new RuntimeFallbacks(pair.Key, pair.Value.Values<string>().ToArray());
}

View file

@ -89,11 +89,9 @@ namespace Microsoft.Extensions.DependencyModel.Tests
var context = Read(
@"{
""runtimes"": {
"".NETStandardApp,Version=v1.5"": {
""osx.10.10-x64"": [ ],
""osx.10.11-x64"": [ ""osx"" ],
""rhel.7-x64"": [ ""linux-x64"", ""unix"" ]
}
""osx.10.10-x64"": [ ],
""osx.10.11-x64"": [ ""osx"" ],
""rhel.7-x64"": [ ""linux-x64"", ""unix"" ]
}
}");
context.RuntimeGraph.Should().Contain(p => p.Runtime == "osx.10.10-x64").Which