From b529f2e246cb4c452bbb1ac463524dc620169e78 Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Wed, 16 Nov 2022 15:53:30 +0100 Subject: [PATCH] (maint) Use IO assertion instead of true/false assertion This commit updates the assertions made to detect whether a file or directory exists or not to instead of assertion on true/false it instead asserts directly using NUnit v3 assertion classes. This is done so if the test fails there will be more information outputted of the failure than just telling whether something was true or false. --- .../scenarios/InstallScenarios.cs | 196 +++++++++--------- .../scenarios/UninstallScenarios.cs | 84 ++++---- .../scenarios/UpgradeScenarios.cs | 124 +++++------ 3 files changed, 202 insertions(+), 202 deletions(-) diff --git a/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs b/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs index 0decd84f0a..9889aecd15 100644 --- a/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs @@ -1,4 +1,4 @@ -// Copyright © 2017 - 2021 Chocolatey Software, Inc +// Copyright © 2017 - 2021 Chocolatey Software, Inc // Copyright © 2011 - 2017 RealDimensions Software, LLC // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -73,7 +73,7 @@ public void should_not_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -122,7 +122,7 @@ public void should_not_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -163,7 +163,7 @@ public override void Because() [Fact] public void should_install_where_install_location_reports() { - Directory.Exists(packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.InstallLocation); } [Fact] @@ -171,7 +171,7 @@ public void should_install_the_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -189,7 +189,7 @@ public void should_create_a_shim_for_console_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "console.exe"); - File.Exists(shimfile).ShouldBeTrue(); + FileAssert.Exists(shimfile); } [Fact] @@ -199,7 +199,7 @@ public void should_create_a_shim_for_graphical_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "graphical.exe"); - File.Exists(shimfile).ShouldBeTrue(); + FileAssert.Exists(shimfile); } [Fact] @@ -207,7 +207,7 @@ public void should_not_create_a_shim_for_ignored_executable_in_the_bin_directory { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "not.installed.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -215,7 +215,7 @@ public void should_not_create_a_shim_for_mismatched_case_ignored_executable_in_t { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "casemismatch.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -223,7 +223,7 @@ public void should_not_create_an_extensions_folder_for_the_package() { var extensionsDirectory = Path.Combine(Scenario.get_top_level(), "extensions", Configuration.PackageNames); - Directory.Exists(extensionsDirectory).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(extensionsDirectory); } [Fact] @@ -231,7 +231,7 @@ public void should_not_create_an_hooks_folder_for_the_package() { var hooksDirectory = Path.Combine(Scenario.get_top_level(), "hooks", Configuration.PackageNames); - Directory.Exists(hooksDirectory).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(hooksDirectory); } [Fact] @@ -364,7 +364,7 @@ public void should_install_where_install_location_reports() { if (packageResult.Value.Name.is_equal_to("missingpackage")) continue; - Directory.Exists(packageResult.Value.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.Value.InstallLocation); } } @@ -381,7 +381,7 @@ public void should_install_expected_packages_in_the_lib_directory() foreach (var package in packagesExpected) { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", package); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } } @@ -390,7 +390,7 @@ public void should_install_the_dependency_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -503,7 +503,7 @@ public void should_still_have_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -578,7 +578,7 @@ public override void Because() [Fact] public void should_install_where_install_location_reports() { - Directory.Exists(packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.InstallLocation); } [Fact] @@ -586,7 +586,7 @@ public void should_install_the_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -609,7 +609,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -701,7 +701,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -872,7 +872,7 @@ public void should_have_a_package_installed_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -889,7 +889,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -946,7 +946,7 @@ public void should_not_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1037,7 +1037,7 @@ public void should_not_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1124,7 +1124,7 @@ public void should_not_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1132,7 +1132,7 @@ public void should_put_a_package_in_the_lib_bad_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bad", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1218,7 +1218,7 @@ public override void Because() [Fact] public void should_install_where_install_location_reports() { - Directory.Exists(packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.InstallLocation); } [Fact] @@ -1226,7 +1226,7 @@ public void should_install_the_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.Input); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1306,7 +1306,7 @@ public void should_not_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1314,7 +1314,7 @@ public void should_put_a_package_in_the_lib_bad_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bad", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1397,7 +1397,7 @@ public override void Because() [Fact] public void should_install_where_install_location_reports() { - Directory.Exists(packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.InstallLocation); } [Fact] @@ -1405,7 +1405,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames) + ".1.0.0"; - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1488,7 +1488,7 @@ public override void Because() [Fact] public void should_install_where_install_location_reports() { - Directory.Exists(packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.InstallLocation); } [Fact] @@ -1496,7 +1496,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames) + ".1.0.0"; - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1564,7 +1564,7 @@ public override void Because() [Fact] public void should_install_where_install_location_reports() { - Directory.Exists(packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.InstallLocation); } [Fact] @@ -1572,7 +1572,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1639,7 +1639,7 @@ public void should_install_where_install_location_reports() { foreach (var packageResult in Results) { - Directory.Exists(packageResult.Value.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.Value.InstallLocation); } } @@ -1648,7 +1648,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1656,7 +1656,7 @@ public void should_install_the_dependency_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1741,7 +1741,7 @@ public void should_install_where_install_location_reports() { foreach (var packageResult in Results) { - Directory.Exists(packageResult.Value.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.Value.InstallLocation); } } @@ -1750,7 +1750,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1766,7 +1766,7 @@ public void should_still_have_the_dependency_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1852,7 +1852,7 @@ public void should_install_where_install_location_reports() { foreach (var packageResult in Results) { - Directory.Exists(packageResult.Value.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.Value.InstallLocation); } } @@ -1861,7 +1861,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1877,7 +1877,7 @@ public void should_install_the_dependency_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1962,7 +1962,7 @@ public void should_install_where_install_location_reports() { foreach (var packageResult in Results) { - Directory.Exists(packageResult.Value.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.Value.InstallLocation); } } @@ -1971,7 +1971,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1987,7 +1987,7 @@ public void should_install_the_dependency_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2073,7 +2073,7 @@ public void should_install_where_install_location_reports() { foreach (var packageResult in Results) { - Directory.Exists(packageResult.Value.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.Value.InstallLocation); } } @@ -2082,7 +2082,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2097,14 +2097,14 @@ public void should_reinstall_the_exact_same_version_of_the_package() public void should_remove_the_floating_dependency() { var dependency = Path.Combine(Scenario.get_top_level(), "lib", "isdependency"); - Directory.Exists(dependency).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(dependency); } [Fact] public void should_remove_the_exact_dependency() { var dependency = Path.Combine(Scenario.get_top_level(), "lib", "isexactversiondependency"); - Directory.Exists(dependency).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(dependency); } [Fact] @@ -2166,7 +2166,7 @@ public void should_not_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -2174,7 +2174,7 @@ public void should_not_install_the_dependency_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency"); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -2276,7 +2276,7 @@ public override void Because() [Fact] public void should_install_where_install_location_reports() { - Directory.Exists(packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.InstallLocation); } [Fact] @@ -2284,7 +2284,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2300,7 +2300,7 @@ public void should_not_install_the_dependency_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency"); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -2363,7 +2363,7 @@ public void should_install_where_install_location_reports() { foreach (var packageResult in Results) { - Directory.Exists(packageResult.Value.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.Value.InstallLocation); } } @@ -2372,7 +2372,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2388,7 +2388,7 @@ public void should_install_the_dependency_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2461,7 +2461,7 @@ public void should_not_install_the_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -2527,7 +2527,7 @@ public void should_install_where_install_location_reports() { foreach (var packageResult in Results) { - Directory.Exists(packageResult.Value.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.Value.InstallLocation); } } @@ -2536,7 +2536,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2611,7 +2611,7 @@ public void should_not_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -2724,7 +2724,7 @@ public void should_install_where_install_location_reports() { foreach (var packageResult in Results) { - Directory.Exists(packageResult.Value.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.Value.InstallLocation); } } @@ -2733,7 +2733,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2809,7 +2809,7 @@ public void should_not_install_the_conflicting_package() { foreach (var packageResult in Results) { - Directory.Exists(packageResult.Value.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.Value.InstallLocation); } } @@ -2819,7 +2819,7 @@ public void should_not_install_the_conflicting_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -2935,7 +2935,7 @@ public void should_not_install_the_conflicting_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -3040,7 +3040,7 @@ public void should_install_where_install_location_reports() { foreach (var packageResult in Results) { - Directory.Exists(packageResult.Value.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.Value.InstallLocation); } } @@ -3050,7 +3050,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -3059,7 +3059,7 @@ public void should_install_the_dependency_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "childdependencywithlooserversiondependency"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -3143,7 +3143,7 @@ public override void Because() [Fact] public void should_install_where_install_location_reports() { - Directory.Exists(packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(packageResult.InstallLocation); } [Fact] @@ -3151,7 +3151,7 @@ public void should_install_the_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "installpackage"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -3169,7 +3169,7 @@ public void should_create_a_shim_for_console_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "console.exe"); - File.Exists(shimfile).ShouldBeTrue(); + FileAssert.Exists(shimfile); } [Fact] @@ -3179,7 +3179,7 @@ public void should_create_a_shim_for_graphical_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "graphical.exe"); - File.Exists(shimfile).ShouldBeTrue(); + FileAssert.Exists(shimfile); } [Fact] @@ -3187,7 +3187,7 @@ public void should_not_create_a_shim_for_ignored_executable_in_the_bin_directory { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "not.installed.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -3195,7 +3195,7 @@ public void should_not_create_a_shim_for_mismatched_case_ignored_executable_in_t { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "casemismatch.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -3203,7 +3203,7 @@ public void should_not_create_an_extensions_folder_for_the_package() { var extensionsDirectory = Path.Combine(Scenario.get_top_level(), "extensions", "installpackage"); - Directory.Exists(extensionsDirectory).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(extensionsDirectory); } [Fact] @@ -3211,7 +3211,7 @@ public void should_not_create_an_hooks_folder_for_the_package() { var hooksDirectory = Path.Combine(Scenario.get_top_level(), "hooks", "installpackage"); - Directory.Exists(hooksDirectory).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(hooksDirectory); } [Fact] @@ -3445,7 +3445,7 @@ public void should_install_the_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -3461,7 +3461,7 @@ public void should_not_create_an_extensions_folder_for_the_package() { var extensionsDirectory = Path.Combine(Scenario.get_top_level(), "extensions", Configuration.PackageNames); - Directory.Exists(extensionsDirectory).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(extensionsDirectory); } [Fact] @@ -3469,7 +3469,7 @@ public void should_create_a_hooks_folder_for_the_package() { var hooksDirectory = Path.Combine(Scenario.get_top_level(), "hooks", Configuration.PackageNames.Replace(".hook", string.Empty)); - Directory.Exists(hooksDirectory).ShouldBeTrue(); + DirectoryAssert.Exists(hooksDirectory); } [Fact] @@ -3548,7 +3548,7 @@ public override void Because() [Fact] public void should_install_where_install_location_reports() { - Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(_packageResult.InstallLocation); } [Fact] @@ -3556,7 +3556,7 @@ public void should_install_the_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -3574,7 +3574,7 @@ public void should_create_a_shim_for_console_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "console.exe"); - File.Exists(shimfile).ShouldBeTrue(); + FileAssert.Exists(shimfile); } [Fact] @@ -3584,7 +3584,7 @@ public void should_create_a_shim_for_graphical_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "graphical.exe"); - File.Exists(shimfile).ShouldBeTrue(); + FileAssert.Exists(shimfile); } [Fact] @@ -3592,7 +3592,7 @@ public void should_not_create_a_shim_for_ignored_executable_in_the_bin_directory { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "not.installed.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -3600,7 +3600,7 @@ public void should_not_create_a_shim_for_mismatched_case_ignored_executable_in_t { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "casemismatch.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -3608,7 +3608,7 @@ public void should_not_create_an_extensions_folder_for_the_package() { var extensionsDirectory = Path.Combine(Scenario.get_top_level(), "extensions", Configuration.PackageNames); - Directory.Exists(extensionsDirectory).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(extensionsDirectory); } [Fact] @@ -3616,7 +3616,7 @@ public void should_not_create_an_hooks_folder_for_the_package() { var hooksDirectory = Path.Combine(Scenario.get_top_level(), "hooks", Configuration.PackageNames); - Directory.Exists(hooksDirectory).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(hooksDirectory); } [Fact] @@ -3802,7 +3802,7 @@ public override void Because() [Fact] public void should_install_where_install_location_reports() { - Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(_packageResult.InstallLocation); } [Fact] @@ -3810,7 +3810,7 @@ public void should_install_the_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -3828,7 +3828,7 @@ public void should_create_a_shim_for_console_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "console.exe"); - File.Exists(shimfile).ShouldBeTrue(); + FileAssert.Exists(shimfile); } [Fact] @@ -3838,7 +3838,7 @@ public void should_create_a_shim_for_graphical_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "graphical.exe"); - File.Exists(shimfile).ShouldBeTrue(); + FileAssert.Exists(shimfile); } [Fact] @@ -3846,7 +3846,7 @@ public void should_not_create_a_shim_for_ignored_executable_in_the_bin_directory { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "not.installed.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -3854,7 +3854,7 @@ public void should_not_create_a_shim_for_mismatched_case_ignored_executable_in_t { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "casemismatch.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -3862,7 +3862,7 @@ public void should_not_create_an_extensions_folder_for_the_package() { var extensionsDirectory = Path.Combine(Scenario.get_top_level(), "extensions", Configuration.PackageNames); - Directory.Exists(extensionsDirectory).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(extensionsDirectory); } [Fact] @@ -3870,7 +3870,7 @@ public void should_not_create_an_hooks_folder_for_the_package() { var hooksDirectory = Path.Combine(Scenario.get_top_level(), "hooks", Configuration.PackageNames); - Directory.Exists(hooksDirectory).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(hooksDirectory); } [Fact] diff --git a/src/chocolatey.tests.integration/scenarios/UninstallScenarios.cs b/src/chocolatey.tests.integration/scenarios/UninstallScenarios.cs index 638f7a979b..0707905fd4 100644 --- a/src/chocolatey.tests.integration/scenarios/UninstallScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/UninstallScenarios.cs @@ -1,4 +1,4 @@ -// Copyright © 2017 - 2021 Chocolatey Software, Inc +// Copyright © 2017 - 2021 Chocolatey Software, Inc // Copyright © 2011 - 2017 RealDimensions Software, LLC // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -77,7 +77,7 @@ public void should_not_uninstall_a_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -151,7 +151,7 @@ public void should_remove_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -159,7 +159,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -169,7 +169,7 @@ public void should_delete_a_shim_for_console_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "console.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -179,7 +179,7 @@ public void should_delete_a_shim_for_graphical_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "graphical.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -187,7 +187,7 @@ public void should_delete_any_files_created_during_the_install() { var generatedFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "simplefile.txt"); - File.Exists(generatedFile).ShouldBeFalse(); + FileAssert.DoesNotExist(generatedFile); } [Fact] @@ -264,7 +264,7 @@ public void should_remove_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -272,7 +272,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -280,7 +280,7 @@ public void should_delete_a_shim_for_console_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "console.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -288,7 +288,7 @@ public void should_delete_a_shim_for_graphical_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "graphical.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -375,7 +375,7 @@ public void should_uninstall_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -383,7 +383,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -450,7 +450,7 @@ public void should_uninstall_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -526,7 +526,7 @@ public void should_not_be_able_to_remove_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -534,7 +534,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -542,7 +542,7 @@ public void should_contain_old_files_in_directory() { var shimFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "tools", "console.exe"); - File.Exists(shimFile).ShouldBeTrue(); + FileAssert.Exists(shimFile); } [Fact] @@ -598,7 +598,7 @@ public void should_keep_the_added_file() { var fileAdded = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "dude.txt"); - File.Exists(fileAdded).ShouldBeTrue(); + FileAssert.Exists(fileAdded); } [Fact] @@ -617,7 +617,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -627,7 +627,7 @@ public void should_delete_a_shim_for_console_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "console.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -637,7 +637,7 @@ public void should_delete_a_shim_for_graphical_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "graphical.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -699,7 +699,7 @@ public void should_keep_the_changed_file() { var fileChanged = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "tools", "chocolateyinstall.ps1"); - File.Exists(fileChanged).ShouldBeTrue(); + FileAssert.Exists(fileChanged); } [Fact] @@ -718,7 +718,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -728,7 +728,7 @@ public void should_delete_a_shim_for_console_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "console.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -738,7 +738,7 @@ public void should_delete_a_shim_for_graphical_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "graphical.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -803,7 +803,7 @@ public void should_remove_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -811,7 +811,7 @@ public void should_not_keep_the_added_file() { var fileChanged = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "dude.txt"); - File.Exists(fileChanged).ShouldBeFalse(); + FileAssert.DoesNotExist(fileChanged); } [Fact] @@ -819,7 +819,7 @@ public void should_not_keep_the_changed_file() { var fileChanged = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "tools", "chocolateyinstall.ps1"); - File.Exists(fileChanged).ShouldBeFalse(); + FileAssert.DoesNotExist(fileChanged); } [Fact] @@ -827,7 +827,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -837,7 +837,7 @@ public void should_delete_a_shim_for_console_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "console.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -847,7 +847,7 @@ public void should_delete_a_shim_for_graphical_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "graphical.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -984,7 +984,7 @@ public void should_not_remove_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -999,7 +999,7 @@ public void should_not_put_the_package_in_the_lib_bad_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bad", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1007,7 +1007,7 @@ public void should_not_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1095,7 +1095,7 @@ public void should_remove_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1103,7 +1103,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1147,7 +1147,7 @@ public void should_remove_hooks_folder_for_the_package() { var hooksDirectory = Path.Combine(Scenario.get_top_level(), "hooks", Configuration.PackageNames.Replace(".hook", string.Empty)); - Directory.Exists(hooksDirectory).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(hooksDirectory); } } @@ -1173,7 +1173,7 @@ public void should_remove_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1181,7 +1181,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1191,7 +1191,7 @@ public void should_delete_a_shim_for_console_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "console.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -1201,7 +1201,7 @@ public void should_delete_a_shim_for_graphical_in_the_bin_directory() { var shimfile = Path.Combine(Scenario.get_top_level(), "bin", "graphical.exe"); - File.Exists(shimfile).ShouldBeFalse(); + FileAssert.DoesNotExist(shimfile); } [Fact] @@ -1209,7 +1209,7 @@ public void should_delete_any_files_created_during_the_install() { var generatedFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "simplefile.txt"); - File.Exists(generatedFile).ShouldBeFalse(); + FileAssert.DoesNotExist(generatedFile); } [Fact] diff --git a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs index 3134ccbe6f..7048d7d0bf 100644 --- a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs @@ -1,4 +1,4 @@ -// Copyright © 2017 - 2021 Chocolatey Software, Inc +// Copyright © 2017 - 2021 Chocolatey Software, Inc // Copyright © 2011 - 2017 RealDimensions Software, LLC // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -109,7 +109,7 @@ public void should_not_create_a_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } } @@ -156,7 +156,7 @@ public void should_not_create_a_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } } @@ -212,7 +212,7 @@ public override void Because() [Fact] public void should_upgrade_where_install_location_reports() { - Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(_packageResult.InstallLocation); } [Fact] @@ -220,7 +220,7 @@ public void should_upgrade_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -228,7 +228,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -386,7 +386,7 @@ public void should_not_create_a_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -394,7 +394,7 @@ public void should_not_remove_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -449,7 +449,7 @@ public override void Because() [Fact] public void should_upgrade_where_install_location_reports() { - Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(_packageResult.InstallLocation); } [Fact] @@ -457,7 +457,7 @@ public void should_upgrade_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -465,7 +465,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -600,7 +600,7 @@ public override void Because() [Fact] public void should_upgrade_where_install_location_reports() { - Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(_packageResult.InstallLocation); } [Fact] @@ -608,7 +608,7 @@ public void should_upgrade_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -616,7 +616,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -778,7 +778,7 @@ public void should_not_create_a_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -786,7 +786,7 @@ public void should_not_remove_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -871,7 +871,7 @@ public void should_not_create_a_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -879,7 +879,7 @@ public void should_not_remove_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -934,7 +934,7 @@ public override void Because() [Fact] public void should_upgrade_where_install_location_reports() { - Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(_packageResult.InstallLocation); } [Fact] @@ -942,7 +942,7 @@ public void should_upgrade_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -958,7 +958,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1069,7 +1069,7 @@ public void should_not_create_a_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1077,7 +1077,7 @@ public void should_not_remove_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1159,7 +1159,7 @@ public void should_not_create_a_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1167,7 +1167,7 @@ public void should_not_remove_the_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1248,7 +1248,7 @@ public override void Because() [Fact] public void should_upgrade_where_install_location_reports() { - Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(_packageResult.InstallLocation); } [Fact] @@ -1256,7 +1256,7 @@ public void should_upgrade_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1272,7 +1272,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1357,7 +1357,7 @@ public override void Because() [Fact] public void should_upgrade_where_install_location_reports() { - Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(_packageResult.InstallLocation); } [Fact] @@ -1365,7 +1365,7 @@ public void should_upgrade_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1469,7 +1469,7 @@ public void should_have_a_package_installed_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1477,7 +1477,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1561,7 +1561,7 @@ public void should_keep_the_added_file() { var fileAdded = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, "dude.txt"); - File.Exists(fileAdded).ShouldBeTrue(); + FileAssert.Exists(fileAdded); } [Fact] @@ -1716,7 +1716,7 @@ public void should_not_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1812,7 +1812,7 @@ public override void Because() [Fact] public void should_install_where_install_location_reports() { - Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(_packageResult.InstallLocation); } [Fact] @@ -1820,7 +1820,7 @@ public void should_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1828,7 +1828,7 @@ public void should_not_have_a_rollback_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1887,7 +1887,7 @@ public void should_not_install_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -1974,7 +1974,7 @@ public void should_not_remove_package_from_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -1990,7 +1990,7 @@ public void should_put_the_package_in_the_lib_bad_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bad", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2006,7 +2006,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -2483,14 +2483,14 @@ public void should_upgrade_the_package() public void should_remove_the_legacy_folder_version_of_the_package() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency.1.0.0"); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] public void should_replace_the_legacy_folder_version_of_the_package_with_a_lib_package_folder_that_has_no_version() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2505,14 +2505,14 @@ public void should_not_upgrade_the_parent_package() public void should_not_add_a_versionless_parent_package_folder_to_the_lib_dir() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "hasdependency"); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] public void should_leave_the_parent_package_as_legacy_folder() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "hasdependency.1.0.0"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2527,14 +2527,14 @@ public void should_not_upgrade_the_exact_version_dependency() public void should_leave_the_exact_version_package_as_legacy_folder() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isexactversiondependency.1.0.0"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] public void should_not_add_a_versionless_exact_version_package_folder_to_the_lib_dir() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isexactversiondependency"); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -2697,14 +2697,14 @@ public void should_upgrade_the_package() public void should_remove_the_legacy_folder_version_of_the_package() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency.1.0.0"); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] public void should_replace_the_legacy_folder_version_of_the_package_with_a_lib_package_folder_that_has_no_version() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isdependency"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2719,7 +2719,7 @@ public void should_upgrade_the_parent_package_to_lowest_version_that_meets_new_d public void should_replace_the_legacy_folder_version_of_the_parent_package_with_a_lib_package_folder_that_has_no_version() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "hasdependency"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2727,7 +2727,7 @@ public void should_replace_the_legacy_folder_version_of_the_parent_package_with_ public void should_remove_the_legacy_folder_version_of_the_parent_package() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "hasdependency.1.0.0"); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -2742,7 +2742,7 @@ public void should_upgrade_the_exact_version_dependency() public void should_replace_the_legacy_folder_version_of_the_exact_version_package_with_a_lib_package_folder_that_has_no_version() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isexactversiondependency"); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -2750,7 +2750,7 @@ public void should_replace_the_legacy_folder_version_of_the_exact_version_packag public void should_remove_the_legacy_folder_version_of_the_exact_version_package() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", "isexactversiondependency.1.0.0"); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -3202,7 +3202,7 @@ public override void Because() [Fact] public void should_upgrade_where_install_location_reports() { - Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(_packageResult.InstallLocation); } [Fact] @@ -3210,7 +3210,7 @@ public void should_upgrade_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -3218,7 +3218,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact] @@ -3288,7 +3288,7 @@ public void should_have_a_hooks_folder_for_the_package() { var hooksDirectory = Path.Combine(Scenario.get_top_level(), "hooks", Configuration.PackageNames.Replace(".hook", string.Empty)); - Directory.Exists(hooksDirectory).ShouldBeTrue(); + DirectoryAssert.Exists(hooksDirectory); } [Fact] @@ -3306,14 +3306,14 @@ public void should_install_hook_scripts_to_folder() public void should_remove_files_not_in_upgrade_version() { var hookScriptPath = Path.Combine(Scenario.get_top_level(), "hooks", Configuration.PackageNames.Replace(".hook", string.Empty), "pre-install-doesnotexist.ps1"); - File.Exists(hookScriptPath).ShouldBeFalse(); + FileAssert.DoesNotExist(hookScriptPath); } [Fact] public void should_install_new_files_in_upgrade_version() { var hookScriptPath = Path.Combine(Scenario.get_top_level(), "hooks", Configuration.PackageNames.Replace(".hook", string.Empty), "post-install-doesnotexist.ps1"); - File.Exists(hookScriptPath).ShouldBeTrue(); + FileAssert.Exists(hookScriptPath); } } @@ -3338,7 +3338,7 @@ public override void Because() [Fact] public void should_upgrade_where_install_location_reports() { - Directory.Exists(_packageResult.InstallLocation).ShouldBeTrue(); + DirectoryAssert.Exists(_packageResult.InstallLocation); } [Fact] @@ -3346,7 +3346,7 @@ public void should_upgrade_a_package_in_the_lib_directory() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeTrue(); + DirectoryAssert.Exists(packageDir); } [Fact] @@ -3354,7 +3354,7 @@ public void should_delete_the_rollback() { var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); - Directory.Exists(packageDir).ShouldBeFalse(); + DirectoryAssert.DoesNotExist(packageDir); } [Fact]