Esempio n. 1
0
        public void Deploy_NoManifest_DoesNothing()
        {
            IProductManifestRepository manifestRepository = Substitute.For <IProductManifestRepository>();
            IServiceDeploymentHandler  deploymentHandler  = Substitute.For <IServiceDeploymentHandler>();

            manifestRepository.GetManifest(Arg.Any <string>(), Arg.Any <string>())
            .Returns((ProductManifest)null);

            this.sut = new DeploymentService(manifestRepository, deploymentHandler);
            this.sut.Deploy("someProduct", "someEnvironment", "someVersion");

            deploymentHandler.DidNotReceiveWithAnyArgs()
            .Deploy(Arg.Any <ProductManifest>(), Arg.Any <string>(), Arg.Any <string>());
        }
Esempio n. 2
0
        public void Deploy_GetsManifest_DeploysServices()
        {
            IProductManifestRepository manifestRepository = Substitute.For <IProductManifestRepository>();
            IServiceDeploymentHandler  deploymentHandler  = Substitute.For <IServiceDeploymentHandler>();

            manifestRepository.GetManifest(Arg.Any <string>(), Arg.Any <string>())
            .Returns(GetTestManifest(2));

            this.sut = new DeploymentService(manifestRepository, deploymentHandler);
            this.sut.Deploy("someProduct", "someEnvironment", "someVersion");

            deploymentHandler.ReceivedWithAnyArgs()
            .Deploy(Arg.Any <ProductManifest>(), Arg.Any <string>(), Arg.Any <string>());
        }
Esempio n. 3
0
        public void Deploy_HasBranch_UsesBranch()
        {
            IProductManifestRepository manifestRepository = Substitute.For <IProductManifestRepository>();
            IServiceDeploymentHandler  deploymentHandler  = Substitute.For <IServiceDeploymentHandler>();

            ProductManifest testManifest = GetTestManifest(2);

            manifestRepository.GetManifest(Arg.Any <string>(), Arg.Any <string>())
            .Returns(testManifest);
            this.sut = new DeploymentService(manifestRepository, deploymentHandler);
            this.sut.Deploy("someProduct", "someEnvironment", "someVersion", "someBranch");

            deploymentHandler.Received()
            .Deploy(testManifest, "someEnvironment", "someVersion", "someBranch");
        }