Add support for Migration defaults (#4242)

* Add support for sdk props/targets defaults to Migration.

* fix the transform applicator

* remove transform applicator dependency on insertion order for item merges

* defaults constructor msbuild version change
This commit is contained in:
Bryan Thornbury 2016-10-20 11:00:41 -07:00 committed by GitHub
parent 6373cdde60
commit ecbc45098d
28 changed files with 1251 additions and 302 deletions

View file

@ -49,16 +49,13 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
}
[Fact]
public void Migrating_empty_buildOptions_populates_only_AssemblyName_Compile_and_EmbeddedResource()
public void Migrating_empty_buildOptions_populates_only_Compile_and_EmbeddedResource()
{
var mockProj = RunBuildOptionsRuleOnPj(@"
{
""buildOptions"": { }
}");
mockProj.Properties.Count().Should().Be(1);
mockProj.Properties.Any(p => !p.Name.Equals("AssemblyName", StringComparison.Ordinal)).Should().BeFalse();
mockProj.Items.Count().Should().Be(2);
mockProj.Items.First(i => i.ItemType == "Compile").Include.Should().Be(@"**\*.cs");
mockProj.Items.First(i => i.ItemType == "Compile").Exclude.Should().Be(@"bin\**;obj\**;**\*.xproj;packages\**");
@ -346,20 +343,6 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
mockProj.Properties.First(p => p.Name == "DebugType").Value.Should().Be("foo");
}
[Fact]
public void Migrating_outputName_populates_AssemblyName()
{
var mockProj = RunBuildOptionsRuleOnPj(@"
{
""buildOptions"": {
""outputName"": ""ARandomName""
}
}");
mockProj.Properties.Count(p => p.Name == "AssemblyName").Should().Be(1);
mockProj.Properties.First(p => p.Name == "AssemblyName").Value.Should().Be("ARandomName");
}
[Fact]
public void Migrating_xmlDoc_populates_GenerateDocumentationFile()
{