Microsoft.WindowsAzure.Commands.Test.Utilities.Common.FileSystemHelper.CreateDirectory C# (CSharp) Method

CreateDirectory() public method

Create a new directory relative to the rootPath.
public CreateDirectory ( string relativePath ) : string
relativePath string Relative path to the directory.
return string
        public string CreateDirectory(string relativePath)
        {
            Debug.Assert(!string.IsNullOrEmpty(relativePath));

            string path = Path.Combine(RootPath, relativePath);
            if (!FileUtilities.DataStore.DirectoryExists(path))
            {
                Log("Creating directory {0}", path);
                FileUtilities.DataStore.CreateDirectory(path);
            }

            return path;
        }

Usage Example

Exemplo n.º 1
0
        public void CreateLocalPackageWithOnePHPWebRoleTest()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                CloudServiceProject service = new CloudServiceProject(files.RootPath, serviceName, null);
                RoleInfo webRoleInfo = service.AddWebRole(Test.Utilities.Common.Data.PHPWebRoleScaffoldingPath);
                string logsDir = Path.Combine(service.Paths.RootPath, webRoleInfo.Name, "server.js.logs");
                string logFile = Path.Combine(logsDir, "0.txt");
                string targetLogsFile = Path.Combine(service.Paths.LocalPackage, "roles", webRoleInfo.Name, @"approot\server.js.logs\0.txt");
                files.CreateDirectory(logsDir);
                files.CreateEmptyFile(logFile);
                service.CreatePackage(DevEnv.Local);

                AzureAssert.ScaffoldingExists(Path.Combine(service.Paths.LocalPackage, @"roles\WebRole1\approot"), Path.Combine(Resources.PHPScaffolding, Resources.WebRole));
                Assert.True(File.Exists(targetLogsFile));
            }
        }
All Usage Examples Of Microsoft.WindowsAzure.Commands.Test.Utilities.Common.FileSystemHelper::CreateDirectory