Save() public method

public Save ( string path ) : void
path string
return void
        public void SetAzureServiceProjectTestsLocationValid()
        {
            string[] locations = { "West US", "East US", "East Asia", "North Europe" };
            foreach (string item in locations)
            {
                using (FileSystemHelper files = new FileSystemHelper(this))
                {
                    // Create new empty settings file
                    //
                    PowerShellProjectPathInfo paths = new PowerShellProjectPathInfo(files.RootPath);
                    ServiceSettings settings = new ServiceSettings();
                    mockCommandRuntime = new MockCommandRuntime();
                    setServiceProjectCmdlet.CommandRuntime = mockCommandRuntime;
                    settings.Save(paths.Settings);

                    settings = setServiceProjectCmdlet.SetAzureServiceProjectProcess(item, null, null, paths.Settings);

                    // Assert location is changed
                    //
                    Assert.Equal<string>(item, settings.Location);
                    ServiceSettings actualOutput = mockCommandRuntime.OutputPipeline[0] as ServiceSettings;
                    Assert.Equal<string>(item, settings.Location);
                }
            }
        }
        public void SetAzureServiceProjectTestsLocationEmptyFail()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                // Create new empty settings file
                //
                PowerShellProjectPathInfo paths = new PowerShellProjectPathInfo(files.RootPath);
                ServiceSettings settings = new ServiceSettings();
                settings.Save(paths.Settings);

                Testing.AssertThrows<ArgumentException>(() => setServiceProjectCmdlet.SetAzureServiceProjectProcess(string.Empty, null, null, paths.Settings), string.Format(Resources.InvalidOrEmptyArgumentMessage, "Location"));
            }
        }
        public void SetAzureServiceProjectTestsUnknownLocation()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                // Create new empty settings file
                //
                PowerShellProjectPathInfo paths = new PowerShellProjectPathInfo(files.RootPath);
                ServiceSettings settings = new ServiceSettings();
                settings.Save(paths.Settings);
                string unknownLocation = "Unknown Location";

                settings = setServiceProjectCmdlet.SetAzureServiceProjectProcess(unknownLocation, null, null, paths.Settings);

                // Assert location is changed
                //
                Assert.Equal<string>(unknownLocation, settings.Location);
                ServiceSettings actualOutput = mockCommandRuntime.OutputPipeline[0] as ServiceSettings;
                Assert.Equal<string>(unknownLocation, settings.Location);
            }
        }
        public void SetAzureServiceProjectTestsSlotTestsInvalidFail()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                // Create new empty settings file
                //
                PowerShellProjectPathInfo paths = new PowerShellProjectPathInfo(files.RootPath);
                ServiceSettings settings = new ServiceSettings();
                settings.Save(paths.Settings);

                Testing.AssertThrows<ArgumentException>(() => setServiceProjectCmdlet.SetAzureServiceProjectProcess(null, "MyHome", null, paths.Settings), string.Format(Resources.InvalidServiceSettingElement, "Slot"));
            }
        }
        public void SetAzureServiceProjectTestsSlotTests()
        {
            string[] slots = { DeploymentSlotType.Production, DeploymentSlotType.Staging };
            foreach (string item in slots)
            {
                using (FileSystemHelper files = new FileSystemHelper(this))
                {
                    // Create new empty settings file
                    //
                    PowerShellProjectPathInfo paths = new PowerShellProjectPathInfo(files.RootPath);
                    ServiceSettings settings = new ServiceSettings();
                    settings.Save(paths.Settings);

                    setServiceProjectCmdlet.SetAzureServiceProjectProcess(null, item, null, paths.Settings);

                    // Assert slot is changed
                    //
                    settings = ServiceSettings.Load(paths.Settings);
                    Assert.Equal<string>(item, settings.Slot);
                }
            }
        }
        public void SetAzureServiceProjectTestsStorageTests()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                // Create new empty settings file
                //
                PowerShellProjectPathInfo paths = new PowerShellProjectPathInfo(files.RootPath);
                ServiceSettings settings = new ServiceSettings();
                mockCommandRuntime = new MockCommandRuntime();
                setServiceProjectCmdlet.CommandRuntime = mockCommandRuntime;
                settings.Save(paths.Settings);

                settings = setServiceProjectCmdlet.SetAzureServiceProjectProcess(null, null, "companystore", paths.Settings);

                // Assert storageAccountName is changed
                //
                Assert.Equal<string>("companystore", settings.StorageServiceName);
                ServiceSettings actualOutput = mockCommandRuntime.OutputPipeline[0] as ServiceSettings;
                Assert.Equal<string>("companystore", settings.StorageServiceName);
            }
        }