From 149c4e94463b0d72cff43dc5f6a6975032feaefe Mon Sep 17 00:00:00 2001 From: TheCakeIsNaOH Date: Thu, 18 Nov 2021 11:10:42 -0600 Subject: [PATCH] (#798) Add tests for install/upgrade pin parameter Add specs for pin parameter for the install/upgrade commands --- .../commands/ChocolateyInstallCommandSpecs.cs | 18 ++++++++++++++++++ .../commands/ChocolateyUpgradeCommandSpecs.cs | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInstallCommandSpecs.cs b/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInstallCommandSpecs.cs index 6b28afd7fb..a930e6a9c9 100644 --- a/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInstallCommandSpecs.cs +++ b/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInstallCommandSpecs.cs @@ -235,6 +235,24 @@ public void should_add_short_version_of_password_to_the_option_set() { optionSet.Contains("p").ShouldBeTrue(); } + + [Fact] + public void should_add_pin_to_the_option_set() + { + optionSet.Contains("pinpackage").ShouldBeTrue(); + } + + [Fact] + public void should_add_long_version_of_pin_to_the_option_set() + { + optionSet.Contains("pin-package").ShouldBeTrue(); + } + + [Fact] + public void should_add_short_version_of_pin_to_the_option_set() + { + optionSet.Contains("pin").ShouldBeTrue(); + } } public class when_handling_additional_argument_parsing : ChocolateyInstallCommandSpecsBase diff --git a/src/chocolatey.tests/infrastructure.app/commands/ChocolateyUpgradeCommandSpecs.cs b/src/chocolatey.tests/infrastructure.app/commands/ChocolateyUpgradeCommandSpecs.cs index 1663a863ac..546eb28499 100644 --- a/src/chocolatey.tests/infrastructure.app/commands/ChocolateyUpgradeCommandSpecs.cs +++ b/src/chocolatey.tests/infrastructure.app/commands/ChocolateyUpgradeCommandSpecs.cs @@ -217,6 +217,24 @@ public void should_add_short_version_of_password_to_the_option_set() { optionSet.Contains("p").ShouldBeTrue(); } + + [Fact] + public void should_add_pin_to_the_option_set() + { + optionSet.Contains("pinpackage").ShouldBeTrue(); + } + + [Fact] + public void should_add_long_version_of_pin_to_the_option_set() + { + optionSet.Contains("pin-package").ShouldBeTrue(); + } + + [Fact] + public void should_add_short_version_of_pin_to_the_option_set() + { + optionSet.Contains("pin").ShouldBeTrue(); + } } public class when_handling_additional_argument_parsing : ChocolateyUpgradeCommandSpecsBase