public static CommandTestBuilderContext WithPackage(this CommandTestBuilderContext context, string packagePath, string packageId, string packageVersion)
        {
            context.Variables.Add(KnownVariables.OriginalPackageDirectoryPath, Path.GetDirectoryName(packagePath));
            context.Variables.Add(TentacleVariables.CurrentDeployment.PackageFilePath, packagePath);
            context.Variables.Add("Octopus.Action.Package.PackageId", packageId);
            context.Variables.Add("Octopus.Action.Package.PackageVersion", packageVersion);
            context.Variables.Add("Octopus.Action.Package.FeedId", "FeedId");

            return(context);
        }
        public static CommandTestBuilderContext WithFilesToCopy(this CommandTestBuilderContext context, string path)
        {
            if (File.Exists(path))
            {
                context.Variables.Add(KnownVariables.OriginalPackageDirectoryPath, Path.GetDirectoryName(path));
            }
            else
            {
                context.Variables.Add(KnownVariables.OriginalPackageDirectoryPath, path);
            }

            context.Variables.Add("Octopus.Test.PackagePath", path);
            context.Variables.Add("Octopus.Action.Package.FeedId", "FeedId");

            return(context);
        }
        public static CommandTestBuilderContext WithNewNugetPackage(this CommandTestBuilderContext context, string packageRootPath, string packageId, string packageVersion)
        {
            var pathToPackage = Path.Combine(packageRootPath, CreateNugetPackage(packageId, packageVersion, packageRootPath));

            return(context.WithPackage(pathToPackage, packageId, packageVersion));
        }