public void SetAzureServiceProjectTestsLocationInvalidFail() { 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 SetAzureServiceProjectCommand().SetAzureServiceProjectProcess("MyHome", null, null, null, paths.Settings), string.Format(Resources.InvalidServiceSettingElement, "Location")); } }
public void SetAzureServiceProjectTestsLocationValid() { foreach (KeyValuePair<Location, string> item in Microsoft.WindowsAzure.Management.CloudService.Model.ArgumentConstants.Locations) { 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 SetAzureServiceProjectCommand().SetAzureServiceProjectProcess(item.Value, null, null, null, paths.Settings); // Assert location is changed // settings = ServiceSettings.Load(paths.Settings); Assert.AreEqual<string>(item.Value, settings.Location); } } }
public void SetAzureServiceProjectTestsSubscriptionEmptyFail() { 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 SetAzureServiceProjectCommand().SetAzureServiceProjectProcess(null, null, null, string.Empty, paths.Settings), string.Format(Resources.InvalidOrEmptyArgumentMessage, "Subscription")); } }
public void SetAzureServiceProjectTestsSubscriptionValid() { 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 SetAzureServiceProjectCommand().SetAzureServiceProjectProcess(null, null, null, item, paths.Settings); // Assert subscription is changed // settings = ServiceSettings.Load(paths.Settings); Assert.AreEqual<string>(item, settings.Subscription); } } }
public void SetAzureServiceProjectTestsStorageTests() { 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 SetAzureServiceProjectCommand().SetAzureServiceProjectProcess(null, null, "companystore", null, paths.Settings); // Assert storageAccountName is changed // settings = ServiceSettings.Load(paths.Settings); Assert.AreEqual<string>("companystore", settings.StorageAccountName); } }