2016-05-11 22:31:11 +00:00
|
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
|
2016-10-28 01:46:43 +00:00
|
|
|
|
using System;
|
2016-05-11 22:31:11 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Tests
|
|
|
|
|
{
|
|
|
|
|
public class GivenThatDotNetRunsCommands : TestBase
|
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public void UnresolvedPlatformReferencesFailAsExpected()
|
|
|
|
|
{
|
2017-02-15 23:35:03 +00:00
|
|
|
|
var testInstance = TestAssets.Get("NonRestoredTestProjects", "TestProjectWithUnresolvedPlatformDependency")
|
|
|
|
|
.CreateInstance()
|
|
|
|
|
.WithSourceFiles()
|
|
|
|
|
.Root.FullName;
|
2016-05-11 22:31:11 +00:00
|
|
|
|
|
|
|
|
|
new RestoreCommand()
|
2017-02-15 23:35:03 +00:00
|
|
|
|
.WithWorkingDirectory(testInstance)
|
2016-10-28 01:46:43 +00:00
|
|
|
|
.ExecuteWithCapturedOutput("/p:SkipInvalidConfigurations=true")
|
2016-05-11 22:31:11 +00:00
|
|
|
|
.Should()
|
|
|
|
|
.Fail();
|
|
|
|
|
|
|
|
|
|
new DotnetCommand()
|
2017-02-15 23:35:03 +00:00
|
|
|
|
.WithWorkingDirectory(testInstance)
|
2016-05-11 22:31:11 +00:00
|
|
|
|
.ExecuteWithCapturedOutput("crash")
|
2016-10-28 01:46:43 +00:00
|
|
|
|
.Should().Fail()
|
|
|
|
|
.And.HaveStdErrContaining("No executable found matching command \"dotnet-crash\"");
|
2016-05-11 22:31:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|