public void AzureSetDeploymentSlotProcessTestsInvalidFail() { using (FileSystemHelper files = new FileSystemHelper(this)) { // Create new empty settings file // ServicePathInfo paths = new ServicePathInfo(files.RootPath); ServiceSettings settings = new ServiceSettings(); settings.Save(paths.Settings); Testing.AssertThrows<ArgumentException>(() => new SetAzureDeploymentSlotCommand().SetAzureDeploymentSlotProcess("MyHome", paths.Settings), string.Format(Resources.InvalidServiceSettingElement, "Slot")); } }
public void AzureSetDeploymentLocationProcessTestsEmptyFail() { using (FileSystemHelper files = new FileSystemHelper(this)) { // Create new empty settings file // ServicePathInfo paths = new ServicePathInfo(files.RootPath); ServiceSettings settings = new ServiceSettings(); settings.Save(paths.Settings); Testing.AssertThrows<ArgumentException>(() => new SetAzureDeploymentLocationCommand().SetAzureDeploymentLocationProcess(string.Empty, paths.Settings), string.Format(Resources.InvalidOrEmptyArgumentMessage, "Location")); } }
public void AzureSetDeploymentStorageAccountNameProcessTests() { using (FileSystemHelper files = new FileSystemHelper(this)) { // Create new empty settings file // ServicePathInfo paths = new ServicePathInfo(files.RootPath); ServiceSettings settings = new ServiceSettings(); settings.Save(paths.Settings); new SetAzureDeploymentStorageCommand().SetAzureDeploymentStorageProcess("companystore", paths.Settings); // Assert storageAccountName is changed // settings = ServiceSettings.Load(paths.Settings); Assert.AreEqual<string>("companystore", settings.StorageAccountName); } }
public void AzureSetDeploymentSlotProcessTests() { foreach (KeyValuePair<Slot, string> item in AzureDeploymentCmdlets.Model.ArgumentConstants.Slots) { using (FileSystemHelper files = new FileSystemHelper(this)) { // Create new empty settings file // ServicePathInfo paths = new ServicePathInfo(files.RootPath); ServiceSettings settings = new ServiceSettings(); settings.Save(paths.Settings); new SetAzureDeploymentSlotCommand().SetAzureDeploymentSlotProcess(item.Value, paths.Settings); // Assert slot is changed // settings = ServiceSettings.Load(paths.Settings); Assert.AreEqual<string>(item.Value, settings.Slot); } } }
public void AzureSetDeploymentSubscriptionProcessTests() { foreach (string item in Data.ValidSubscriptionName) { using (FileSystemHelper files = new FileSystemHelper(this)) { // Create new empty settings file // ServicePathInfo paths = new ServicePathInfo(files.RootPath); ServiceSettings settings = new ServiceSettings(); settings.Save(paths.Settings); new SetAzureDeploymentSubscriptionCommand().SetAzureDeploymentSubscriptionProcess(item, paths.Settings); // Assert subscription is changed // settings = ServiceSettings.Load(paths.Settings); Assert.AreEqual<string>(item, settings.Subscription); } } }