public void Deploy_DoesntGetVersion_DoesntDeploy() { IServiceDeploymentExecutor deploymentExecutor = Substitute.For <IServiceDeploymentExecutor>(); this.sut = new SequentialDeploymentHandler(deploymentExecutor, 0); this.sut.Deploy(GetTestManifest(2), environment: "someEnvironment", productVersion: "wrongVersion"); deploymentExecutor.DidNotReceiveWithAnyArgs().Deploy(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <string>()); }
public void Deploy_Whatif_DoesntWait() { IServiceDeploymentExecutor deploymentExecutor = Substitute.For <IServiceDeploymentExecutor>(); deploymentExecutor.Deploy(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <string>(), Arg.Any <string>()).Returns(true); Stack <DeploymentStatus> statusResults = new Stack <DeploymentStatus>(); statusResults.Push(DeploymentStatus.Succeeded); statusResults.Push(DeploymentStatus.InProgress); deploymentExecutor.GetDeploymentStatus( Arg.Any <string>(), Arg.Any <string>(), Arg.Any <string>()).Returns(x => statusResults.Pop()); this.sut = new SequentialDeploymentHandler(deploymentExecutor, 0, new Options { WhatIf = true }); this.sut.Deploy(GetTestManifest(1), environment: "someEnvironment", productVersion: "someVersion"); deploymentExecutor.DidNotReceiveWithAnyArgs().GetDeploymentStatus(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <string>()); }