Microsoft.WindowsAzure.Commands.Test.Utilities.Common.AzureAssert.ScaffoldingExists C# (CSharp) Method

ScaffoldingExists() public static method

public static ScaffoldingExists ( string destinationDirectory, string scaffoldFilePath, string roleName = "WebRole" ) : void
destinationDirectory string
scaffoldFilePath string
roleName string
return void
        public static void ScaffoldingExists(string destinationDirectory, string scaffoldFilePath, string roleName = "WebRole")
        {
            Scaffold scaffold = Scaffold.Parse(Path.Combine(Data.TestResultDirectory, scaffoldFilePath, Resources.ScaffoldXml));

            foreach (ScaffoldFile file in scaffold.Files)
            {
                if (file.Copy)
                {

                    string elementPath;
                    if (string.IsNullOrEmpty(file.PathExpression))
                    {
                        elementPath = string.IsNullOrEmpty(file.TargetPath) ? Path.Combine(destinationDirectory, file.Path) : Path.Combine(destinationDirectory, file.TargetPath);
                        elementPath = elementPath.Replace("$RoleName$", roleName);
                        Assert.IsTrue(File.Exists(elementPath));
                    }
                    else
                    {
                        string substring = file.PathExpression.Substring(0, file.PathExpression.LastIndexOf('\\'));
                        elementPath = string.IsNullOrEmpty(file.TargetPath) ? Path.Combine(destinationDirectory, substring) : Path.Combine(destinationDirectory, file.TargetPath);
                        elementPath = elementPath.Replace("$RoleName$", roleName);
                        Assert.IsTrue(Directory.Exists(elementPath));
                    }
                }
            }
        }