fix tests
This commit is contained in:
parent
fe8f440ed6
commit
5523f24712
2 changed files with 9 additions and 9 deletions
|
@ -216,7 +216,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
|
|
||||||
var migratedProjectReferenceItem = migratedProjectReferenceItems.First();
|
var migratedProjectReferenceItem = migratedProjectReferenceItems.First();
|
||||||
migratedProjectReferenceItem.Include.Should().Be(projectReference);
|
migratedProjectReferenceItem.Include.Should().Be(projectReference);
|
||||||
migratedProjectReferenceItem.Condition.Should().Be(" '$(Foo)' == 'bar' and '$(Bar)' == 'foo'");
|
migratedProjectReferenceItem.Condition.Should().Be(" '$(Bar)' == 'foo' and '$(Foo)' == 'bar' ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ using Microsoft.DotNet.ProjectJsonMigration.Rules;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
{
|
{
|
||||||
public class GivenThatIWantToMigrateProjectFramework : TestBase
|
public class GivenThatIWantToMigrateTFMs : TestBase
|
||||||
{
|
{
|
||||||
[Fact(Skip="Emitting this until x-targetting full support is in")]
|
[Fact(Skip="Emitting this until x-targetting full support is in")]
|
||||||
public void Migrating_netcoreapp_project_Does_not_populate_TargetFrameworkIdentifier_and_TargetFrameworkVersion()
|
public void Migrating_netcoreapp_project_Does_not_populate_TargetFrameworkIdentifier_and_TargetFrameworkVersion()
|
||||||
|
@ -51,12 +51,12 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
.FromTestAssetBase("TestLibraryWithMultipleFrameworks")
|
.FromTestAssetBase("TestLibraryWithMultipleFrameworks")
|
||||||
.SaveToDisk(testDirectory);
|
.SaveToDisk(testDirectory);
|
||||||
|
|
||||||
var projectContext = ProjectContext.Create(testDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp10);
|
var projectContexts = ProjectContext.CreateContextForEachFramework(testDirectory);
|
||||||
var mockProj = ProjectRootElement.Create();
|
var mockProj = ProjectRootElement.Create();
|
||||||
|
|
||||||
var migrationSettings = new MigrationSettings(testDirectory, testDirectory, "1.0.0", mockProj);
|
var migrationSettings = new MigrationSettings(testDirectory, testDirectory, "1.0.0", mockProj);
|
||||||
var migrationInputs = new MigrationRuleInputs(
|
var migrationInputs = new MigrationRuleInputs(
|
||||||
new[] { projectContext },
|
projectContexts,
|
||||||
mockProj,
|
mockProj,
|
||||||
mockProj.AddItemGroup(),
|
mockProj.AddItemGroup(),
|
||||||
mockProj.AddPropertyGroup());
|
mockProj.AddPropertyGroup());
|
||||||
|
@ -69,7 +69,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Migrating_Single_TFM_project_Populates_TargetFrameworks_with_short_tfm()
|
public void Migrating_Single_TFM_project_does_not_Populate_TargetFrameworks()
|
||||||
{
|
{
|
||||||
var testDirectory = Temp.CreateDirectory().Path;
|
var testDirectory = Temp.CreateDirectory().Path;
|
||||||
var testPJ = new ProjectJsonBuilder(TestAssetsManager)
|
var testPJ = new ProjectJsonBuilder(TestAssetsManager)
|
||||||
|
@ -80,21 +80,21 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
||||||
})
|
})
|
||||||
.SaveToDisk(testDirectory);
|
.SaveToDisk(testDirectory);
|
||||||
|
|
||||||
var projectContext = ProjectContext.Create(testDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp10);
|
var projectContexts = ProjectContext.CreateContextForEachFramework(testDirectory);
|
||||||
var mockProj = ProjectRootElement.Create();
|
var mockProj = ProjectRootElement.Create();
|
||||||
|
|
||||||
// Run BuildOptionsRule
|
// Run BuildOptionsRule
|
||||||
var migrationSettings = new MigrationSettings(testDirectory, testDirectory, "1.0.0", mockProj);
|
var migrationSettings = new MigrationSettings(testDirectory, testDirectory, "1.0.0", mockProj);
|
||||||
var migrationInputs = new MigrationRuleInputs(
|
var migrationInputs = new MigrationRuleInputs(
|
||||||
new[] { projectContext },
|
projectContexts,
|
||||||
mockProj,
|
mockProj,
|
||||||
mockProj.AddItemGroup(),
|
mockProj.AddItemGroup(),
|
||||||
mockProj.AddPropertyGroup());
|
mockProj.AddPropertyGroup());
|
||||||
|
|
||||||
new MigrateTFMRule().Apply(migrationSettings, migrationInputs);
|
new MigrateTFMRule().Apply(migrationSettings, migrationInputs);
|
||||||
|
Console.WriteLine(mockProj.RawXml);
|
||||||
|
|
||||||
mockProj.Properties.Count(p => p.Name == "TargetFrameworks").Should().Be(1);
|
mockProj.Properties.Count(p => p.Name == "TargetFrameworks").Should().Be(0);
|
||||||
mockProj.Properties.First(p => p.Name == "TargetFrameworks").Value.Should().Be("netcoreapp1.0");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue