当前位置: 首页>>代码示例>>C#>>正文


C# FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings方法代码示例

本文整理汇总了C#中Microsoft.WindowsAzure.Management.Test.Utilities.Common.FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings方法的典型用法代码示例。如果您正苦于以下问题:C# FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings方法的具体用法?C# FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings怎么用?C# FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.WindowsAzure.Management.Test.Utilities.Common.FileSystemHelper的用法示例。


在下文中一共展示了FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetDeploymentStatusProcessDeploymentDoesNotExistTest

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

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

                Assert.IsFalse(statusUpdated);
                Assert.IsTrue(resultMessage.Contains(expectedMessage));
                Assert.IsTrue(((MockCommandRuntime)deploymentManager.CommandRuntime).OutputPipeline.Count.Equals(0));
            }
        }
开发者ID:bueti,项目名称:azure-sdk-tools,代码行数:29,代码来源:DeploymentStatusManagerTests.cs

示例2: TestCreateStorageServiceWithPublish

        public void TestCreateStorageServiceWithPublish()
        {
            using (FileSystemHelper files = new FileSystemHelper(this) { EnableMonitoring = true })
            {
                // Setup
                string rootPath = files.CreateNewService(serviceName);
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                CloudServiceProject cloudServiceProject = new CloudServiceProject(rootPath, null);
                cloudServiceProject.AddWebRole(Data.NodeWebRoleScaffoldingPath);
                cloudService.Deployments.Add(deployment);
                serviceManagementChannelMock.Setup(f => f.EndGetStorageService(It.IsAny<IAsyncResult>()))
                    .Callback(() => serviceManagementChannelMock.Setup(f => f.EndGetStorageService(
                        It.IsAny<IAsyncResult>()))
                        .Returns(storageService))
                    .Throws(new EndpointNotFoundException());

                ExecuteInTempCurrentDirectory(rootPath, () => client.PublishCloudService(location: "West US"));

                serviceManagementChannelMock.Verify(f => f.BeginCreateStorageService(
                    subscription.SubscriptionId,
                    It.IsAny<CreateStorageServiceInput>(),
                    null,
                    null), Times.Once());
            }
        }
开发者ID:xmbms,项目名称:azure-sdk-tools,代码行数:25,代码来源:CloudServiceClientTests.cs

示例3: RemoveAzureServiceProcessTest

        public void RemoveAzureServiceProcessTest()
        {
            bool serviceDeleted = false;
            bool deploymentDeleted = false;
            channel.GetDeploymentBySlotThunk = ar =>
            {
                if (deploymentDeleted) throw new ServiceManagementClientException(HttpStatusCode.NotFound, new ServiceManagementError(), string.Empty);
                return new Deployment{Name = serviceName, DeploymentSlot = ArgumentConstants.Slots[SlotType.Production], Status = DeploymentStatus.Suspended};
            };
            channel.DeleteHostedServiceThunk = ar => serviceDeleted = true;
            channel.DeleteDeploymentBySlotThunk = ar =>
            {
                deploymentDeleted = true;
            };
            channel.IsDNSAvailableThunk = ida => new AvailabilityResponse { Result = false };

            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                AzureService service = new AzureService(files.RootPath, serviceName, null);
                removeServiceCmdlet.PassThru = true;
                removeServiceCmdlet.RemoveAzureServiceProcess(service.Paths.RootPath, string.Empty, serviceName);
                Assert.IsTrue(deploymentDeleted);
                Assert.IsTrue(serviceDeleted);
                Assert.IsTrue((bool)mockCommandRuntime.OutputPipeline[0]);
            }
        }
开发者ID:bryanhunter,项目名称:azure-sdk-tools,代码行数:27,代码来源:RemoveAzureServiceTests.cs

示例4: DisableRemoteDesktopForEmptyService

 public void DisableRemoteDesktopForEmptyService()
 {
     using (FileSystemHelper files = new FileSystemHelper(this))
     {
         files.CreateAzureSdkDirectoryAndImportPublishSettings();
         files.CreateNewService("NEW_SERVICE");
         disableRDCmdlet.DisableRemoteDesktop();
     }
 }
开发者ID:bryanhunter,项目名称:azure-sdk-tools,代码行数:9,代码来源:DisableAzureRemoteDesktopCommandTest.cs

示例5: DisableRemoteDesktopForWebAndWorkerRoles

 public void DisableRemoteDesktopForWebAndWorkerRoles()
 {
     using (FileSystemHelper files = new FileSystemHelper(this))
     {
         files.CreateAzureSdkDirectoryAndImportPublishSettings();
         string rootPath = files.CreateNewService("NEW_SERVICE");
         addNodeWebCmdlet = new AddAzureNodeWebRoleCommand() { RootPath = rootPath, CommandRuntime = mockCommandRuntime, Name = "WebRole" };
         addNodeWebCmdlet.ExecuteCmdlet();
         addNodeWorkerCmdlet = new AddAzureNodeWorkerRoleCommand() { RootPath = rootPath, CommandRuntime = mockCommandRuntime, Name = "WorkerRole" };
         addNodeWorkerCmdlet.ExecuteCmdlet();
         disableRDCmdlet.DisableRemoteDesktop();
     }
 }
开发者ID:bryanhunter,项目名称:azure-sdk-tools,代码行数:13,代码来源:DisableAzureRemoteDesktopCommandTest.cs

示例6: DisableRemoteDesktopForWebRole

        public void DisableRemoteDesktopForWebRole()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                string rootPath = files.CreateNewService("NEW_SERVICE");
                addNodeWebCmdlet = new AddAzureNodeWebRoleCommand() { RootPath = rootPath, CommandRuntime = mockCommandRuntime, Name = "WebRole" };
                addNodeWebCmdlet.ExecuteCmdlet();
                disableRDCmdlet.PassThru = true;
                disableRDCmdlet.DisableRemoteDesktop();

                Assert.IsTrue((bool)mockCommandRuntime.OutputPipeline[1]);
            }
        }
开发者ID:bryanhunter,项目名称:azure-sdk-tools,代码行数:14,代码来源:DisableAzureRemoteDesktopCommandTest.cs

示例7: GetDefaultLocationWithWithRandomLocation

        public void GetDefaultLocationWithWithRandomLocation()
        {
            // 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, null, "My-Custom-Service!", null, out serviceName);
                Assert.IsTrue(settings.Location.Equals(ArgumentConstants.Locations[LocationName.WestUS]) ||
                    settings.Location.Equals(ArgumentConstants.Locations[LocationName.EastUS]));

            }
        }
开发者ID:bryanhunter,项目名称:azure-sdk-tools,代码行数:15,代码来源:ServiceSettingsTests.cs

示例8: GetDefaultLocationWithUnknwonLocation

        public void GetDefaultLocationWithUnknwonLocation()
        {
            // 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;
                string unknownLocation = "Unknown Location";

                ServiceSettings settings = ServiceSettings.LoadDefault(null, null, unknownLocation, null, null, null, "My-Custom-Service!", null, out serviceName);
                Assert.AreEqual<string>(unknownLocation.ToLower(), settings.Location.ToLower());

            }
        }
开发者ID:redwater,项目名称:azure-sdk-tools,代码行数:15,代码来源:ServiceSettingsTests.cs

示例9: 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, null, "I HAVE INVALID CHARACTERS [email protected]#$%", null, null, out serviceName));
                Testing.AssertThrows<ArgumentException>(() =>
                    ServiceSettings.LoadDefault(null, null, null, null, null, "ihavevalidcharsbutimjustwaytooooooooooooooooooooooooooooooooooooooooolong", null, null, out serviceName));
            }
        }
开发者ID:redwater,项目名称:azure-sdk-tools,代码行数:15,代码来源:ServiceSettingsTests.cs

示例10: 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, null, "My-Custom-Service!", null, out serviceName);
                Assert.AreEqual("myx2dcustomx2dservicex21", settings.StorageServiceName);

                settings = ServiceSettings.LoadDefault(null, null, null, null, null, null, "MyCustomServiceIsWayTooooooooooooooooooooooooLong", null, out serviceName);
                Assert.AreEqual("mycustomserviceiswaytooo", settings.StorageServiceName);
            }
        }
开发者ID:redwater,项目名称:azure-sdk-tools,代码行数:16,代码来源:ServiceSettingsTests.cs

示例11: TestStopAzureService

        public void TestStopAzureService()
        {
            stopServiceCmdlet.ServiceName = serviceName;
            stopServiceCmdlet.Slot = slot;
            cloudServiceClientMock.Setup(f => f.StopCloudService(serviceName, slot));

            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                AzureService service = new AzureService(files.RootPath, serviceName, null);
                stopServiceCmdlet.ExecuteCmdlet();

                Assert.AreEqual<int>(0, mockCommandRuntime.OutputPipeline.Count);
                cloudServiceClientMock.Verify(f => f.StopCloudService(serviceName, slot), Times.Once());
            }
        }
开发者ID:TanaryTai,项目名称:azure-sdk-tools,代码行数:16,代码来源:StopAzureServiceTests.cs

示例12: TestCreatePackageSuccessfull

        public void TestCreatePackageSuccessfull()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                files.CreateNewService("NEW_SERVICE");
                string rootPath = Path.Combine(files.RootPath, "NEW_SERVICE");
                string packagePath = Path.Combine(rootPath, Resources.CloudPackageFileName);

                AzureService service = new AzureService(rootPath, null);
                service.AddWebRole(Data.NodeWebRoleScaffoldingPath);

                cmdlet.ExecuteCmdlet();

                PSObject obj = mockCommandRuntime.OutputPipeline[0] as PSObject;
                Assert.AreEqual<string>(string.Format(Resources.PackageCreated, packagePath), mockCommandRuntime.VerboseStream[0]);
                Assert.AreEqual<string>(packagePath, obj.GetVariableValue<string>(Parameters.PackagePath));
                Assert.IsTrue(File.Exists(packagePath));
            }
        }
开发者ID:johnkors,项目名称:azure-sdk-tools,代码行数:20,代码来源:SaveAzureServiceProjectPackageTests.cs

示例13: TestPublishNewCloudService

        public void TestPublishNewCloudService()
        {
            using (FileSystemHelper files = new FileSystemHelper(this) { EnableMonitoring = true })
            {
                // Setup
                string rootPath = files.CreateNewService(serviceName);
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                CloudServiceProject cloudServiceProject = new CloudServiceProject(rootPath, null);
                cloudServiceProject.AddWebRole(Data.NodeWebRoleScaffoldingPath);

                ExecuteInTempCurrentDirectory(rootPath, () => client.PublishCloudService(location: "West US"));

                serviceManagementChannelMock.Verify(f => f.BeginCreateOrUpdateDeployment(
                    subscription.SubscriptionId,
                    serviceName,
                    DeploymentSlotType.Production,
                    It.IsAny<CreateDeploymentInput>(),
                    null,
                    null), Times.Once());
            }
        }
开发者ID:xmbms,项目名称:azure-sdk-tools,代码行数:21,代码来源:CloudServiceClientTests.cs

示例14: SetDeploymentStatusProcessWithNotExistingServiceFail

        public void SetDeploymentStatusProcessWithNotExistingServiceFail()
        {
            string newStatus = DeploymentStatus.Running;
            string currentStatus = DeploymentStatus.Suspended;
            bool statusUpdated = false;
            channel.UpdateDeploymentStatusBySlotThunk = ar =>
            {
                statusUpdated = true;
                channel.GetDeploymentBySlotThunk = ar2 => new Deployment{Name = serviceName, DeploymentSlot = slot, Status = newStatus};
            };
            channel.GetDeploymentBySlotThunk = ar => new Deployment{Name = serviceName, DeploymentSlot = slot, Status = currentStatus};
            channel.IsDNSAvailableThunk = ida => new AvailabilityResponse { Result = true };

            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                files.CreateAzureSdkDirectoryAndImportPublishSettings();
                AzureService service = new AzureService(files.RootPath, serviceName, null);
                startServiceCmdlet.SetDeploymentStatusProcess(service.Paths.RootPath, newStatus, slot, Data.ValidSubscriptionName[0], serviceName);

                Assert.IsFalse(statusUpdated);
            }
        }
开发者ID:bryanhunter,项目名称:azure-sdk-tools,代码行数:22,代码来源:StartAzureServiceTests.cs

示例15: EnableRemoteDesktopForEmptyService

 public void EnableRemoteDesktopForEmptyService()
 {
     using (FileSystemHelper files = new FileSystemHelper(this))
     {
         files.CreateAzureSdkDirectoryAndImportPublishSettings();
         files.CreateNewService("NEW_SERVICE");
         Testing.AssertThrows<InvalidOperationException>(() =>
             EnableRemoteDesktop("user", "GoodPassword!"));
     }
 }
开发者ID:xmbms,项目名称:azure-sdk-tools,代码行数:10,代码来源:EnableAzureRemoteDesktopCommandTest.cs


注:本文中的Microsoft.WindowsAzure.Management.Test.Utilities.Common.FileSystemHelper.CreateAzureSdkDirectoryAndImportPublishSettings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。