dotnet-installer/test/dotnet-build.Tests/BuildInvalidArgumentsTests.cs
Andrew Stanton-Nurse 7cc90d9ad1 Update dotnet-build to produce portable layout
dotnet-build will produce a deps file for portable builds, and will now
create "runnable" outputs for RID-less targets

the outputs won't actually be runnable today because we need corehost
changes and to generate a deps.json file for corehost to use.
2016-03-08 11:46:15 -08:00

55 lines
2.2 KiB
C#

using System.IO;
using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
namespace Microsoft.DotNet.Tools.Builder.Tests
{
public class BuildInvalidArgumentsTests : TestBase
{
[Fact]
public void ErrorOccursWhenBuildingPortableProjectToSpecificOutputPathWithoutSpecifyingFramework()
{
var testInstance = TestAssetsManager.CreateTestInstance("BuildTestPortableProject")
.WithLockFiles();
var result = new BuildCommand(
projectPath: testInstance.TestRoot,
output: Path.Combine(testInstance.TestRoot, "out"))
.ExecuteWithCapturedOutput();
result.Should().Fail();
result.Should().HaveStdErrContaining("When the '--output' option is provided, the '--framework' option must also be provided.");
}
[Fact]
public void ErrorOccursWhenBuildingPortableProjectAndSpecifyingFrameworkThatProjectDoesNotSupport()
{
var testInstance = TestAssetsManager.CreateTestInstance("BuildTestPortableProject")
.WithLockFiles();
var result = new BuildCommand(
projectPath: testInstance.TestRoot,
output: Path.Combine(testInstance.TestRoot, "out"),
framework: "sl40")
.ExecuteWithCapturedOutput();
result.Should().Fail();
result.Should().HaveStdErrContaining("Project does not support framework: Silverlight,Version=v4.0.");
}
[Fact]
public void ErrorOccursWhenBuildingStandaloneProjectToSpecificOutputPathWithoutSpecifyingFramework()
{
var testInstance = TestAssetsManager.CreateTestInstance("BuildTestStandaloneProject")
.WithLockFiles();
var result = new BuildCommand(
projectPath: testInstance.TestRoot,
output: Path.Combine(testInstance.TestRoot, "out"))
.ExecuteWithCapturedOutput();
result.Should().Fail();
result.Should().HaveStdErrContaining("When the '--output' option is provided, the '--framework' option must also be provided.");
}
}
}