Added a test to ensure that C# projects created by dotnet-new are built without warnings.

This commit is contained in:
dasMulli 2016-05-03 23:07:50 +02:00
parent d39a905a5b
commit d2cedd318f

View file

@ -35,6 +35,24 @@ namespace Microsoft.DotNet.Tests
.Should().Pass();
}
[Fact]
public void When_dotnet_build_is_invoked_Then_project_builds_without_warnings()
{
var rootPath = Temp.CreateDirectory().Path;
new TestCommand("dotnet") { WorkingDirectory = rootPath }
.Execute("new");
new TestCommand("dotnet") { WorkingDirectory = rootPath }
.Execute("restore");
var buildResult = new TestCommand("dotnet") { WorkingDirectory = rootPath }
.ExecuteWithCapturedOutput("build");
buildResult.Should().Pass();
buildResult.Should().NotHaveStdErr();
}
private static void AddProjectJsonDependency(string projectJsonPath, string dependencyId, string dependencyVersion)
{
var projectJsonRoot = ReadProject(projectJsonPath);