public void EnableRemoteDesktopBasicParameterValidation() { using (FileSystemHelper files = new FileSystemHelper(this)) { files.CreateAzureSdkDirectoryAndImportPublishSettings(); files.CreateNewService("NEW_SERVICE"); Testing.AssertThrows <ArgumentException>( () => EnableRemoteDesktop(null, null)); Testing.AssertThrows <ArgumentException>( () => EnableRemoteDesktop(string.Empty, string.Empty)); Testing.AssertThrows <ArgumentException>( () => EnableRemoteDesktop("user", null)); Testing.AssertThrows <ArgumentException>( () => EnableRemoteDesktop("user", string.Empty)); Testing.AssertThrows <ArgumentException>( () => EnableRemoteDesktop("user", "short")); Testing.AssertThrows <ArgumentException>( () => EnableRemoteDesktop("user", "onlylower")); Testing.AssertThrows <ArgumentException>( () => EnableRemoteDesktop("user", "ONLYUPPER")); Testing.AssertThrows <ArgumentException>( () => EnableRemoteDesktop("user", "1234567890")); } }
public void EnableRemoteDesktopForEmptyService() { using (FileSystemHelper files = new FileSystemHelper(this)) { files.CreateAzureSdkDirectoryAndImportPublishSettings(); files.CreateNewService("NEW_SERVICE"); Testing.AssertThrows <InvalidOperationException>(() => EnableRemoteDesktop("user", "GoodPassword!")); } }
public void AddNewCacheWorkerRoleWithInvalidNamesFail() { using (FileSystemHelper files = new FileSystemHelper(this)) { string rootPath = Path.Combine(files.RootPath, "AzureService"); newServiceCmdlet.NewAzureServiceProcess(files.RootPath, "AzureService"); foreach (string invalidName in Data.InvalidRoleNames) { Testing.AssertThrows <ArgumentException>(() => addCacheRoleCmdlet.AddAzureCacheWorkerRoleProcess(invalidName, 1, rootPath)); } } }
public void EnableRemoteDesktopUnicodeAndShortPasswordFails() { using (FileSystemHelper files = new FileSystemHelper(this)) { files.CreateAzureSdkDirectoryAndImportPublishSettings(); string rootPath = files.CreateNewService("NEW_SERVICE"); addNodeWebCmdlet = new AddAzureNodeWebRoleCommand() { RootPath = rootPath, CommandRuntime = mockCommandRuntime, Name = "WebRole", Instances = 1 }; addNodeWebCmdlet.ExecuteCmdlet(); Testing.AssertThrows <ArgumentException>(() => EnableRemoteDesktop("㯑䲘䄂㮉", "㯑䲘")); } }
public void InvalidStorageAccountName() { // Create a temp directory that we'll use to "publish" our service using (FileSystemHelper files = new FileSystemHelper(this) { EnableMonitoring = true }) { // Import our default publish settings files.CreateAzureSdkDirectoryAndImportPublishSettings(); string serviceName = null; Testing.AssertThrows <ArgumentException>(() => ServiceSettings.LoadDefault(null, null, null, null, null, "I HAVE INVALID CHARACTERS !@#$%", null, null, out serviceName)); Testing.AssertThrows <ArgumentException>(() => ServiceSettings.LoadDefault(null, null, null, null, null, "ihavevalidcharsbutimjustwaytooooooooooooooooooooooooooooooooooooooooolong", null, null, out serviceName)); } }