DeploymentTracker.Services.Entities.BuildArgs.Validate C# (CSharp) Method

Validate() public method

Validates this instance.
public Validate ( ) : void
return void
        public void Validate()
        {
            this.TFSUrl.VerifyNotNull("TFS Url", "TFS Url cannot be null");
            this.SolutionName.VerifyNotNull("Solution Name", "Solution Name cannot be null");
            this.TFSWorkingPath.VerifyNotNull("TFS Working Path", "TFS Working Path cannot be null");
            this.DeploymentLogPath.VerifyNotNull("Deployment Log Path", "Deployment Log Path cannot be null");
            this.Version.VerifyNotNull("Version", "Version cannot be generated");
        }

Usage Example

        /// <summary>
        /// Initializes a new instance of the <see cref="BuildTasks"/> class.
        /// </summary>
        /// <param name="tfsurl">The tfsurl.</param>
        /// <param name="solutionName">Name of the solution.</param>
        public BuildTasks(BuildArgs buildArgs)
        {
            buildArgs.Validate();

            // Initialize
            this.tfsurl = buildArgs.TFSUrl;

            this.modifiedSolutionName = buildArgs.ModifiedSolutionName; // CreateUniqueBuildDirectory(buildArgs.SolutionName, buildArgs.TFSWorkingPath);

            // TFS log files
            this.teamfoundationLogFilePath = Path.Combine(buildArgs.DeploymentLogPath, string.Concat(this.modifiedSolutionName, Constants.LogsFolderExtension), string.Concat(this.modifiedSolutionName, Constants.TFSLogIdentifier, Constants.LogExtension));

            // Default workspace folder
            this.dedicatedWorkspacePath = Path.Combine(buildArgs.TFSWorkingPath, this.modifiedSolutionName);

            // MSbuild files
            this.msbuildLogFilePath = Path.Combine(buildArgs.DeploymentLogPath, string.Concat(this.modifiedSolutionName, Constants.LogsFolderExtension), string.Concat(this.modifiedSolutionName, Constants.MSBuildLogIdentifier, Constants.LogExtension));
            this.msbuildDeploymentFolder = Path.Combine(this.dedicatedWorkspacePath, Constants.DeploymentCodeFolderName);
            this.packagesFolder = Path.Combine(this.dedicatedWorkspacePath, Constants.AzurePackagesFolderName);

            // create required folder-setup
            this.CreateRequiredFolders();

            // Now intialize log stream to log file
            this.logStreamWriter = File.AppendText(this.teamfoundationLogFilePath);
            this.logStreamWriter.WriteLine(string.Format("Deployment process started at {0}", DateTime.Now));
        }
BuildArgs