Пример #1
0
        public static JObject PrepareParameters(DeploymentInput deploymentInput, DeploymentOutput deploymentOutput, string path)
        {
            deploymentInput.AssertNotNull(nameof(deploymentInput));
            deploymentOutput.AssertNotNull(nameof(deploymentOutput));
            path.AssertNotEmpty(nameof(path));

            var parameterFileContents = TemplateHelper.GetJsonFileContents(path);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.AdminUserName][TemplateConstants.ValueSection] = new JValue(deploymentInput.VirtualMachineAdminUserName);
            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.AdminPassword][TemplateConstants.ValueSection] = new JValue(deploymentInput.VirtualMachineAdminUserNamePassword);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.UserName][TemplateConstants.ValueSection]     = new JValue(deploymentInput.VirtualMachineUserName);
            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.UserPassword][TemplateConstants.ValueSection] = new JValue(deploymentInput.VirtualMachineUserNamePassword);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.DomainNameLabel][TemplateConstants.ValueSection]    = new JValue(deploymentOutput.VirtualMachineDomainName);
            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.VirtualMachineName][TemplateConstants.ValueSection] = new JValue(deploymentOutput.VirtualMachineName);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.TagClassName][TemplateConstants.ValueSection] = new JValue(deploymentOutput.ClassName);
            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.TagClassId][TemplateConstants.ValueSection]   = new JValue(deploymentOutput.ClassId);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.TagStudentEmail][TemplateConstants.ValueSection] = new JValue(deploymentOutput.StudentEmailAddress);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.TagStudentName][TemplateConstants.ValueSection] = new JValue(deploymentOutput.StudentName);

            return(parameterFileContents);
        }
Пример #2
0
        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);
        }
Пример #3
0
		private void grdDeployments_OnDoubleClick(object sender, EventArgs e)
		{
			var selectedRows = grdDeployments.SelectedRows;

			if (selectedRows.Count == 1)
			{
				var repository = ObjectFactory.GetInstance<IDeploymentRepository>();

				var deploymentId = new Guid(selectedRows[0].Cells[6].FormattedValue.ToString());
				var deployment = repository.GetById(deploymentId);
				var outputText = deployment.Output.Output;
				var outputWindow = new DeploymentOutput { Output = outputText};
				outputWindow.ShowDialog();
			}
		}