Merge pull request #2538 from sokket/nrefix

Fixing #2480 to produce an InvalidProjectException for invalid projects
This commit is contained in:
Jonathan Miller 2016-04-18 13:57:57 -07:00
commit 18ae4d4791
4 changed files with 45 additions and 0 deletions

View file

@ -294,5 +294,26 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
var command = new TestCommand(Path.Combine(publishedDir.FullName, outputExe));
command.Execute("").Should().ExitWith(0);
}
[Fact]
public void PublishFailsWhenProjectRootIsEmpty()
{
using (var dir = new DisposableDirectory(Temp))
{
var command = new TestCommand("dotnet");
command.Execute($"publish {dir.Path}").Should().Fail();
}
}
[Fact]
public void PublishFailsWhenProjectJsonDoesNotExist()
{
using (var dir = new DisposableDirectory(Temp))
{
var command = new TestCommand("dotnet");
string temp = Path.Combine(dir.Path, "project.json");
command.Execute($"publish {temp}").Should().Fail();
}
}
}
}