Merge pull request #947 from dotnet/pakrym/configtest3

Add test for desktop config generation
This commit is contained in:
Pavel Krymets 2016-01-25 09:59:48 -08:00
commit 231cc037fd
3 changed files with 34 additions and 5 deletions

View file

@ -138,6 +138,7 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
{ {
// create unique directories in the 'temp' folder // create unique directories in the 'temp' folder
var root = Temp.CreateDirectory(); var root = Temp.CreateDirectory();
root.CopyFile(Path.Combine(_testProjectsRoot, "global.json"));
var testLibDir = root.CreateDirectory("TestLibraryWithRunner"); var testLibDir = root.CreateDirectory("TestLibraryWithRunner");
//copy projects to the temp dir //copy projects to the temp dir
@ -146,7 +147,7 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
RunRestore(testLibDir.Path); RunRestore(testLibDir.Path);
var testProject = GetProjectPath(testLibDir); var testProject = GetProjectPath(testLibDir);
var publishCommand = new PublishCommand(testProject); var publishCommand = new PublishCommand(testProject, "net451");
publishCommand.Execute().Should().Pass(); publishCommand.Execute().Should().Pass();
publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryWithRunner.dll"); publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryWithRunner.dll");
@ -155,6 +156,17 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryWithRunner.dll.config"); publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryWithRunner.dll.config");
// dependencies should also be copied // dependencies should also be copied
publishCommand.GetOutputDirectory().Should().HaveFile("Newtonsoft.Json.dll"); publishCommand.GetOutputDirectory().Should().HaveFile("Newtonsoft.Json.dll");
publishCommand.GetOutputDirectory().Delete(true);
publishCommand = new PublishCommand(testProject, "dnxcore50", PlatformServices.Default.Runtime.GetLegacyRestoreRuntimeIdentifier());
publishCommand.Execute().Should().Pass();
publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryWithRunner.dll");
publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryWithRunner.pdb");
publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryWithRunner.deps");
publishCommand.GetOutputDirectory().Should().NotHaveFile("TestLibraryWithRunner.dll.config");
// dependencies should also be copied
publishCommand.GetOutputDirectory().Should().HaveFile("Newtonsoft.Json.dll");
} }
[Fact] [Fact]

View file

@ -3,6 +3,18 @@
<packageSources> <packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below --> <!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear /> <clear />
<add key="dotnet-core" value="https://www.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="nugetbuild" value="https://www.myget.org/F/nugetbuild/api/v3/index.json" />
<add key="AspNetCIDev" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
<add key="roslyn-nightly" value="https://www.myget.org/F/roslyn-nightly/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" /> <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-corefxlab" value="https://www.myget.org/F/dotnet-corefxlab/api/v3/index.json" />
<add key="corefxlab" value="https://www.myget.org/F/netcore-package-prototyping/api/v3/index.json" />
<add key="corert" value="https://www.myget.org/F/dotnet/api/v2" />
<add key="dotnet-buildtools" value="https://www.myget.org/F/dotnet-buildtools/api/v3/index.json" />
<add key="fsharp-daily" value="https://www.myget.org/F/fsharp-daily/api/v3/index.json" />
</packageSources> </packageSources>
<activePackageSource>
<add key="AspNetCIDev" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
</activePackageSource>
</configuration> </configuration>

View file

@ -2,12 +2,17 @@
"version": "1.0.0-*", "version": "1.0.0-*",
"testRunner": "xunit", "testRunner": "xunit",
"dependencies": { "dependencies": {
"Microsoft.AspNet.Mvc.Formatters.Json": "6.0.0-rc1-final", "Microsoft.Extensions.DependencyModel": "1.0.0-*",
"Newtonsoft.Json": "3.5.8", "Newtonsoft.Json": "6.0.0",
"System.Runtime": "4.0.0"
}, },
"frameworks": { "frameworks": {
"dnx451": { } "net451": { },
"dnxcore50": {
"imports" : "portable-net45+wp80+win8",
"dependencies": {
"NETStandard.Library": "1.0.0-rc2-23704"
}
}
} }
} }