Refactoring the ProjectTypeDetector to use the Project in the MigrationInputs.

This commit is contained in:
Livar Cunha 2016-10-28 22:11:13 -07:00
parent 2d27092513
commit 9e88b811a0
3 changed files with 57 additions and 48 deletions

View file

@ -61,15 +61,17 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
""Microsoft.AspNetCore.Mvc"" : {
""version"": ""1.0.0""
}
},
""frameworks"": {
""netcoreapp1.0"": {}
}
}");
var packageRef = mockProj.Items.FirstOrDefault(i =>
i.Include == "Microsoft.NET.Sdk.Web" && i.ItemType == "PackageReference");
var packageRef = mockProj.Items.First(i => i.Include == "Microsoft.NET.Sdk.Web" && i.ItemType == "PackageReference");
var privateAssetsMetadata = packageRef.GetMetadataWithName("PrivateAssets");
privateAssetsMetadata.Value.Should().NotBeNull();
privateAssetsMetadata.Value.Should().Be("All");
packageRef.Should().NotBeNull();
packageRef.GetMetadataWithName("PrivateAssets").Value.Should().NotBeNull().And.Be("All");
}
[Fact]