當前位置: 首頁>>代碼示例>>C#>>正文


C# FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings方法代碼示例

本文整理匯總了C#中Microsoft.WindowsAzure.Management.Test.Stubs.FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings方法的典型用法代碼示例。如果您正苦於以下問題:C# FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings方法的具體用法?C# FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings怎麽用?C# FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.WindowsAzure.Management.Test.Stubs.FileSystemHelper的用法示例。


在下文中一共展示了FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetDeploymentStatusProcessDeploymentDoesNotExistTest

        public void SetDeploymentStatusProcessDeploymentDoesNotExistTest()
        {
            SimpleServiceManagement channel = new SimpleServiceManagement();
            string newStatus = DeploymentStatus.Running;
            string resultMessage;
            string expectedMessage = string.Format(Resources.ServiceSlotDoesNotExist, serviceName, slot);
            bool statusUpdated = false;
            channel.UpdateDeploymentStatusBySlotThunk = ar =>
            {
                statusUpdated = true;
                channel.GetDeploymentBySlotThunk = ar2 => new Deployment(serviceName, slot, newStatus);
            };
            channel.GetDeploymentBySlotThunk = ar => { throw new EndpointNotFoundException(); };

            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                AzureService service = new AzureService(files.RootPath, serviceName, null);
                var deploymentManager = new DeploymentStatusManager(channel);
                deploymentManager.ShareChannel = true;
                resultMessage = deploymentManager.SetDeploymentStatusProcess(service.Paths.RootPath, newStatus, slot, Data.ValidSubscriptionName[0], serviceName);

                Assert.IsFalse(statusUpdated);
                Assert.AreEqual<string>(expectedMessage, resultMessage);
            }
        }
開發者ID:jt2073,項目名稱:azure-sdk-tools,代碼行數:26,代碼來源:DeploymentStatusManagerTests.cs

示例2: RemoveAzureServiceProcessTest

        public void RemoveAzureServiceProcessTest()
        {
            SimpleServiceManagement channel = new SimpleServiceManagement();
            bool serviceDeleted = false;
            bool deploymentDeleted = false;
            channel.GetDeploymentBySlotThunk = ar =>
            {
                if (deploymentDeleted) throw new EndpointNotFoundException();
                return new Deployment(serviceName, ArgumentConstants.Slots[Slot.Production], DeploymentStatus.Suspended);
            };
            channel.DeleteHostedServiceThunk = ar => serviceDeleted = true;
            channel.DeleteDeploymentBySlotThunk = ar =>
            {
                deploymentDeleted = true;
            };

            using (FileSystemHelper files = new FileSystemHelper(this))
            {

                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                AzureService service = new AzureService(files.RootPath, serviceName, null);
                var removeAzureServiceCommand = new RemoveAzureServiceCommand(channel);
                removeAzureServiceCommand.ShareChannel = true;
                removeAzureServiceCommand.RemoveAzureServiceProcess(service.Paths.RootPath, string.Empty, serviceName);
                Assert.IsTrue(deploymentDeleted);
                Assert.IsTrue(serviceDeleted);
            }
        }
開發者ID:paulyuk,項目名稱:azure-sdk-tools,代碼行數:28,代碼來源:RemoveAzureServiceTests.cs

示例3: InvalidStorageAccountName

        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, "I HAVE INVALID CHARACTERS [email protected]#$%", null, null, out serviceName));
                Testing.AssertThrows<ArgumentException>(() =>
                    ServiceSettings.LoadDefault(null, null, null, null, "ihavevalidcharsbutimjustwaytooooooooooooooooooooooooooooooooooooooooolong", null, null, out serviceName));
            }
        }
開發者ID:paulyuk,項目名稱:azure-sdk-tools,代碼行數:15,代碼來源:ServiceSettingsTests.cs

示例4: SanitizeServiceNameForStorageAccountName

        public void SanitizeServiceNameForStorageAccountName()
        {
            // 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;
                ServiceSettings settings = ServiceSettings.LoadDefault(null, null, null, null, null, "My-Custom-Service!", null, out serviceName);
                Assert.AreEqual("myx2dcustomx2dservicex21", settings.StorageAccountName);

                settings = ServiceSettings.LoadDefault(null, null, null, null, null, "MyCustomServiceIsWayTooooooooooooooooooooooooLong", null, out serviceName);
                Assert.AreEqual("mycustomserviceiswaytooo", settings.StorageAccountName);
            }
        }
開發者ID:paulyuk,項目名稱:azure-sdk-tools,代碼行數:16,代碼來源:ServiceSettingsTests.cs

示例5: SetDeploymentStatusProcessTest

        public void SetDeploymentStatusProcessTest()
        {
            SimpleServiceManagement channel = new SimpleServiceManagement();
            string newStatus = DeploymentStatus.Running;
            string currentStatus = DeploymentStatus.Suspended;
            bool statusUpdated = false;
            channel.UpdateDeploymentStatusBySlotThunk = ar =>
            {
                statusUpdated = true;
                channel.GetDeploymentBySlotThunk = ar2 => new Deployment(serviceName, slot, newStatus);
            };
            channel.GetDeploymentBySlotThunk = ar => new Deployment(serviceName, slot, currentStatus);

            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                AzureService service = new AzureService(files.RootPath, serviceName, null);
                var startAzureService = new StartAzureService(channel) { ShareChannel = true };
                startAzureService.SetDeploymentStatusProcess(service.Paths.RootPath, newStatus, slot, Data.ValidSubscriptionName[0], serviceName);

                Assert.IsTrue(statusUpdated);
            }
        }
開發者ID:andrei-s,項目名稱:azure-sdk-tools,代碼行數:23,代碼來源:StartAzureServiceTests.cs

示例6: SetupTest

 public void SetupTest()
 {
     CmdletSubscriptionExtensions.SessionManager = new InMemorySessionManager();
     files = new FileSystemHelper(this);
     files.CreateAzureSdkDirectoryAndImportPublishSettings();
 }
開發者ID:huangpf,項目名稱:azure-sdk-tools,代碼行數:6,代碼來源:AddAzureVhdCommandTests.cs


注:本文中的Microsoft.WindowsAzure.Management.Test.Stubs.FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。