e8c5d23c29
* display CommandParsing gracefully This set of changes handles CommandParsingException gracefuly (so as not to show the user a stack trace) and generalizes graceful exception display somewhat away from being type-specific. * fix compile error by inlining constant * remove unused test logging
26 lines
783 B
C#
26 lines
783 B
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 FluentAssertions;
|
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
using System;
|
|
using System.Linq;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Microsoft.DotNet.New.Tests
|
|
{
|
|
public class NewCommandTests
|
|
{
|
|
[Fact]
|
|
public void WhenSwitchIsSkippedThenItPrintsError()
|
|
{
|
|
var cmd = new DotnetCommand().Execute("new Web1.1");
|
|
|
|
cmd.ExitCode.Should().NotBe(0);
|
|
|
|
cmd.StdErr.Should().Be("Unrecognized command or argument 'Web1.1'");
|
|
cmd.StdOut.Should().Be("Specify --help for a list of available options and commands.");
|
|
}
|
|
}
|
|
}
|