2017-01-30 22:36:44 +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.
|
|
|
|
|
|
|
|
using FluentAssertions;
|
|
|
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.New.Tests
|
|
|
|
{
|
2017-07-18 15:34:08 +00:00
|
|
|
public class NewCommandTests : TestBase
|
2017-01-30 22:36:44 +00:00
|
|
|
{
|
|
|
|
[Fact]
|
|
|
|
public void WhenSwitchIsSkippedThenItPrintsError()
|
|
|
|
{
|
|
|
|
var cmd = new DotnetCommand().Execute("new Web1.1");
|
|
|
|
|
|
|
|
cmd.ExitCode.Should().NotBe(0);
|
2017-02-01 01:31:37 +00:00
|
|
|
|
2017-07-18 15:34:08 +00:00
|
|
|
if (!DotnetUnderTest.IsLocalized())
|
|
|
|
{
|
|
|
|
cmd.StdErr.Should().StartWith("No templates matched the input template name: Web1.1.");
|
|
|
|
}
|
2017-02-01 01:31:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public void WhenTemplateNameIsNotUniquelyMatchedThenItIndicatesProblemToUser()
|
|
|
|
{
|
|
|
|
var cmd = new DotnetCommand().Execute("new c");
|
|
|
|
|
|
|
|
cmd.ExitCode.Should().NotBe(0);
|
|
|
|
|
2017-07-18 15:34:08 +00:00
|
|
|
if (!DotnetUnderTest.IsLocalized())
|
|
|
|
{
|
|
|
|
cmd.StdErr.Should().StartWith("Unable to determine the desired template from the input template name: c.");
|
|
|
|
}
|
2017-02-01 01:31:37 +00:00
|
|
|
}
|
|
|
|
}
|
2017-01-30 22:36:44 +00:00
|
|
|
}
|