08e9bc903e
* Rebase * Remove Multi-Project Validator * Remove projectmodelserver tests * Enable test package creation * Incremental test restore * WiP * Enable Test Asset Project restore * Build Test Assets & Restore Test Projects * Build Test projects * Enable Test Execution also moves Test Targets to a well-known CLI Version [Stage 2] * Pass throuh existing telemetry profile * 2-space tabs * Revert TestTargets.cs * WiP PR feedback * Refactoring * Fix naming of RestoreTestAssetPackages * DotNetTest task * Fix merge issue * ExecuteWithCapturedOutput MSBuild considers StdErr output to be failures. This causes output of any test command which is expected to produce an error to be swallowed in the test. * Workaround for always-on tracing functionality in dotnet-test * Fix Path Separator Windows/Unix * Seperate package build from pack * Windows Pathing issues * PR Feedback * Workaround for msbuild #773 https://github.com/Microsoft/msbuild/issues/773
36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
// 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.
|
||
|
||
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()
|
||
{
|
||
var testAssetsManager = GetTestGroupTestAssetsManager("NonRestoredTestProjects");
|
||
var testInstance = testAssetsManager.CreateTestInstance("TestProjectWithUnresolvedPlatformDependency");
|
||
|
||
new RestoreCommand()
|
||
.WithWorkingDirectory(testInstance.TestRoot)
|
||
.ExecuteWithCapturedOutput()
|
||
.Should()
|
||
.Fail();
|
||
new DirectoryInfo(testInstance.TestRoot)
|
||
.Should()
|
||
.HaveFile("project.lock.json");
|
||
|
||
new DotnetCommand()
|
||
.ExecuteWithCapturedOutput("crash")
|
||
.Should()
|
||
.Fail()
|
||
.And
|
||
.HaveStdErrContaining("No executable found matching command \"dotnet-crash\"");
|
||
}
|
||
}
|
||
}
|