Пример #1
0
        public void Download_ShouldQueueJob()
        {
            var          downloader      = new FakeDownloader();
            var          job             = new DownloadJob(downloader, new FakeClock());
            var          runner          = JobRunnerTest.CreateJobRunner();
            var          jobRunner       = new ChefJobRunner(runner, job, CreateInstallChefJob(), RunChefJobTest.CreateRunChefJob());
            const string expectedVersion = "1.2.3";

            jobRunner.DownloadJob.Download(expectedVersion);

            runner.ProcessQueue();

            downloader.DownloadedVersion.Should().Be(expectedVersion, "because the download should have been there");
        }
Пример #2
0
        public void Install_ShouldQueueJob()
        {
            var fakeInstaller = new FakeInstaller();
            var installJob    = new InstallJob(fakeInstaller, new FakeClock());
            var runner        = JobRunnerTest.CreateJobRunner();
            var jobProcessor  = new ChefJobRunner(runner, CreateDownloadJob(), installJob, RunChefJobTest.CreateRunChefJob());

            var expectedVersion = "1.2.3";

            jobProcessor.InstallJob.InstallOrUpgrade(expectedVersion);

            runner.ProcessQueue();

            fakeInstaller.InstalledVersion.ToString().Should().Be(expectedVersion);
        }
Пример #3
0
 private ChefJobRunner CreateChefJobRunner()
 {
     return(new ChefJobRunner(JobRunnerTest.CreateJobRunner(), CreateDownloadJob(), CreateInstallChefJob(), RunChefJobTest.CreateRunChefJob()));
 }