public override void ExecuteCmdlet()
{
string output = !string.IsNullOrEmpty(Output) ? this.TryResolvePath(Output) :
Web.IsPresent ?
Path.Combine(CurrentPath(), DefaultWebRoleTemplate) :
Path.Combine(CurrentPath(), DefaultWorkerRoleTemplate);
string source = Web.IsPresent ? Path.Combine(Resources.GeneralScaffolding, Resources.WebRole) : Path.Combine(Resources.GeneralScaffolding, Resources.WorkerRole);
FileUtilities.DirectoryCopy(FileUtilities.GetContentFilePath(source), output, true);
SafeWriteOutputPSObject(null, Parameters.Path, output);
}
}
public void NewAzureRoleTemplateWithWorkerRole() { string outputPath = Path.Combine(Directory.GetCurrentDirectory(), "WorkerRoleTemplate"); addTemplateCmdlet = new NewAzureRoleTemplateCommand() { Worker = true, CommandRuntime = mockCommandRuntime }; addTemplateCmdlet.ExecuteCmdlet(); Assert.Equal<string>(outputPath, ((PSObject)mockCommandRuntime.OutputPipeline[0]).GetVariableValue<string>(Parameters.Path)); Testing.AssertDirectoryIdentical(Path.Combine(Resources.GeneralScaffolding, RoleType.WorkerRole.ToString()), outputPath); }