Exemplo n.º 1
0
 public UpdateService(NovoClient novoClient, WindowsInstallerClient windowsInstallerClient, IPackageRepository packageRepository,
                      IInstallService installService, IEnvInfo envInfo, Logger logger)
 {
     _novoClient             = novoClient;
     _windowsInstallerClient = windowsInstallerClient;
     _packageRepository      = packageRepository;
     _installService         = installService;
     _envInfo = envInfo;
     _logger  = logger;
 }
Exemplo n.º 2
0
        public InstallerContext(string packageId, InstallInteractivityLevel interactivityLevel, WindowsInstallerClient installerClient, NexClient nexClient)
        {
            _packageId         = packageId;
            _installerClient   = installerClient;
            _nexClient         = nexClient;
            InteractivityLevel = interactivityLevel;


            _preOperationInstallRecords = installerClient.GetRecords();
            _stopWatch = Stopwatch.StartNew();
        }
Exemplo n.º 3
0
        public void diff_should_return_empty_for_same_list()
        {
            var installerClient = new WindowsInstallerClient();

            var diffGenerator = new DiffGenerator <WindowsInstallerRecord>(installerClient.GetRecords(), installerClient.GetRecords(), c => $"{c.Is64}_{c.Id}");


            diffGenerator.Added().Should().BeEmpty();
            diffGenerator.Removed().Should().BeEmpty();
            diffGenerator.Updated().Should().BeEmpty();
        }
Exemplo n.º 4
0
        public void diff_should_show_removed()
        {
            var installerClient = new WindowsInstallerClient();

            var before = installerClient.GetRecords();
            var after  = installerClient.GetRecords();

            after.RemoveAt(20);

            var diffGenerator = new DiffGenerator <WindowsInstallerRecord>(before, after, c => $"{c.Is64}_{c.Id}");


            diffGenerator.Added().Should().BeEmpty();
            diffGenerator.Removed().Should().HaveCount(1);
            diffGenerator.Updated().Should().BeEmpty();
        }
Exemplo n.º 5
0
        public void diff_should_show_updated()
        {
            var installerClient = new WindowsInstallerClient();

            var before = installerClient.GetRecords();
            var after  = installerClient.GetRecords();

            after[20].Values["foo"] = "bar";

            var diffGenerator = new DiffGenerator <WindowsInstallerRecord>(before, after, c => $"{c.Is64}_{c.Id}");


            diffGenerator.Added().Should().BeEmpty();
            diffGenerator.Removed().Should().BeEmpty();
            diffGenerator.Updated().Should().OnlyContain(c => c.Values["foo"].ToString() == "bar");
        }
Exemplo n.º 6
0
        public void diff_should_show_added()
        {
            var installerClient = new WindowsInstallerClient();

            var before = installerClient.GetRecords();
            var after  = installerClient.GetRecords();

            var newRecord = new WindowsInstallerRecord
            {
                Id = "new"
            };

            after.Add(newRecord);

            var diffGenerator = new DiffGenerator <WindowsInstallerRecord>(before, after, c => $"{c.Is64}_{c.Id}");


            diffGenerator.Added().Should().OnlyContain(c => c == newRecord);
            diffGenerator.Removed().Should().BeEmpty();
            diffGenerator.Updated().Should().BeEmpty();
        }
Exemplo n.º 7
0
 public InstallerContextFactory(WindowsInstallerClient windowsInstallerClient, NexClient nexClient)
 {
     _windowsInstallerClient = windowsInstallerClient;
     _nexClient = nexClient;
 }
Exemplo n.º 8
0
        public NovoClientFixture()
        {
            var installerClient = new WindowsInstallerClient();

            _installerRecords = installerClient.GetRecords();
        }