Merge pull request #4536 from krwq/outputNameIssue

Migrating project with OutputName
This commit is contained in:
Livar 2016-10-28 20:55:18 -07:00 committed by GitHub
commit 22a5a15ba9
3 changed files with 41 additions and 3 deletions

View file

@ -394,6 +394,31 @@ namespace Microsoft.DotNet.Migration.Tests
VerifyAllMSBuildOutputsRunnable(projectDirectory);
}
[Fact]
public void It_migrates_project_with_output_name()
{
string projectName = "AppWithOutputAssemblyName";
string expectedOutputName = "MyApp";
var projectDirectory = TestAssetsManager.CreateTestInstance(projectName, callingMethod: $"It_migrates_{projectName}")
.WithLockFiles()
.Path;
string expectedCsprojPath = Path.Combine(projectDirectory, $"{projectName}.csproj");
if (File.Exists(expectedCsprojPath))
{
File.Delete(expectedCsprojPath);
}
CleanBinObj(projectDirectory);
MigrateProject(projectDirectory);
File.Exists(expectedCsprojPath).Should().BeTrue();
Restore(projectDirectory, projectName);
BuildMSBuild(projectDirectory, projectName);
Directory.EnumerateFiles(Path.Combine(projectDirectory, "bin"), $"{expectedOutputName}.pdb", SearchOption.AllDirectories)
.Count().Should().Be(1);
}
private void VerifyAutoInjectedDesktopReferences(string projectDirectory, string projectName, bool shouldBePresent)
{
if (projectName != null)
@ -540,7 +565,7 @@ namespace Microsoft.DotNet.Migration.Tests
result.Should().Pass();
}
private void MigrateProject(string[] migrateArgs)
private void MigrateProject(params string[] migrateArgs)
{
var result =
MigrateCommand.Run(migrateArgs);