Exemplo n.º 1
0
		public Deployment CreateDeployment(string application, string environment, string deployedBy, string output, string version, bool failed)
		{
			var deployment = new Deployment
			                 	{
			                 		Application = application,
			                 		Environment = environment,
			                 		Version = version,
			                 		DeployedBy = deployedBy,
			                 		DeployedOn = _clock.GetCurrentDateTime(),
			                 		Result = (failed || (_resultCalculator.GetResult(output) == DeploymentResult.Failure)) ? DeploymentResult.Failure : DeploymentResult.Success
			                 	};

			deployment.SetOutput(new DeploymentOutput {Output = output});

			return deployment;
		}
		public void Can_persist_deployment()
		{
			var deployment = new Deployment
			{
				Application = "SampleApp1",
				Environment = "Development",
				CertifiedBy = "Certifer",
				DeployedBy = "Deployer",
				DeployedOn = new DateTime(2007, 3, 15),
				CertifiedOn = new DateTime(2007, 4, 15),
				Version = "250",
				Result = DeploymentResult.Failure
			};

			var output = new DeploymentOutput { Output = "Output text", Deployment = deployment };
			deployment.SetOutput(output);

			AssertObjectCanBePersisted(deployment);
		}