Exemple #1
0
        private FakeInstalledProductsFinder CreateProductsFinderWithChefInstalled()
        {
            var finder = new FakeInstalledProductsFinder();

            finder.InstalledProducts.Add(CreateProductInstallationMetaData("12.17.44"));
            return(finder);
        }
Exemple #2
0
        public void InstallOrUpgrade_ShouldUninstallExistingProductThenInstallNewOne()
        {
            var chefInstallationMetaData = CreateProductInstallationMetaData("1.2.3");
            var finder    = new FakeInstalledProductsFinder(chefInstallationMetaData);
            var installer = new FakeProductInstaller(finder);

            var product = new ChefProduct("chef", finder, installer, InstalledProductsFinder.IsChefClient);

            const string versionInstalled = "15.1.2";

            product.InstallOrUpgrade(versionInstalled, new FakeMessagePresenter());

            installer.ProductCodeUninstalled.Should()
            .Be(chefInstallationMetaData.Parent,
                "because since the product is already installed, we should uninstall it");
            installer.VersionInstalled.Should().Be(versionInstalled);
        }
Exemple #3
0
 public FakeProductInstaller(FakeInstalledProductsFinder installedProductsFinder)
 {
     _installedProductsFinder = installedProductsFinder;
 }
Exemple #4
0
 private ChefProduct CreateChefProduct(FakeInstalledProductsFinder finder)
 {
     return(new ChefProduct("chef", finder, new FakeProductInstaller(finder), InstalledProductsFinder.IsChefClient));
 }
Exemple #5
0
 private static ChefProduct CreateChefProduct(FakeInstalledProductsFinder finder, FakeProductInstaller fakeProductInstaller)
 {
     return(new ChefProduct("chef", finder, fakeProductInstaller, InstalledProductsFinder.IsChefClient));
 }
Exemple #6
0
        private ChefProduct CreateChefProduct(FakeInstalledProductsFinder finder)
        {
            var fakeProductInstaller = new FakeProductInstaller(finder);

            return(CreateChefProduct(finder, fakeProductInstaller));
        }