GivenThatTheUserRequestsHelp.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. namespace dotnet.Tests
  4. {
  5. public class GivenThatTheUserRequestsHelp : SdkTest
  6. {
  7. public GivenThatTheUserRequestsHelp(ITestOutputHelper log) : base(log)
  8. {
  9. }
  10. [Theory]
  11. [InlineData("-h")]
  12. [InlineData("add -h")]
  13. [InlineData("add package -h")]
  14. [InlineData("add reference -h")]
  15. [InlineData("build -h")]
  16. [InlineData("clean -h")]
  17. [InlineData("list -h")]
  18. [InlineData("msbuild -h")]
  19. [InlineData("new -h --debug:ephemeral-hive")]
  20. [InlineData("nuget -h")]
  21. [InlineData("pack -h")]
  22. [InlineData("publish -h")]
  23. [InlineData("remove -h")]
  24. [InlineData("restore -h")]
  25. [InlineData("run -h")]
  26. [InlineData("sln -h")]
  27. [InlineData("sln add -h")]
  28. [InlineData("sln list -h")]
  29. [InlineData("sln remove -h")]
  30. [InlineData("store -h")]
  31. [InlineData("test -h")]
  32. public void TheResponseIsNotAnError(string commandLine)
  33. {
  34. var result = new DotnetCommand(Log)
  35. .Execute(commandLine.Split());
  36. result.ExitCode.Should().Be(0);
  37. }
  38. [Theory]
  39. [InlineData("faketool -h")]
  40. public void TheResponseIsAnError(string commandLine)
  41. {
  42. var result = new DotnetCommand(Log)
  43. .Execute(commandLine.Split());
  44. result.ExitCode.Should().Be(1);
  45. }
  46. }
  47. }