Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GetAzureProviderCmdletTests"/> class.
        /// </summary>
        public UnregisterAzureProviderCmdletTests(ITestOutputHelper output)
        {
            this.providerOperationsMock = new Mock <IProvidersOperations>();
            XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
            var resourceManagementClient = new Mock <IResourceManagementClient>();

            resourceManagementClient
            .SetupGet(client => client.Providers)
            .Returns(() => this.providerOperationsMock.Object);

            this.commandRuntimeMock = new Mock <ICommandRuntime>();

            this.commandRuntimeMock
            .Setup(m => m.ShouldProcess(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(() => true);

            this.cmdlet = new UnregisterAzureProviderCmdlet
            {
                CommandRuntime           = commandRuntimeMock.Object,
                ResourceManagerSdkClient = new ResourceManagerSdkClient
                {
                    ResourceManagementClient = resourceManagementClient.Object
                }
            };
            PSCmdletExtensions.SetCommandRuntimeMock(cmdlet, commandRuntimeMock.Object);
            mockRuntime = new MockCommandRuntime();
            commandRuntimeMock.Setup(f => f.Host).Returns(mockRuntime.Host);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GetAzureProviderCmdletTests"/> class.
        /// </summary>
        public UnregisterAzureProviderCmdletTests()
        {
            this.providerOperationsMock = new Mock <IProviderOperations>();
            var resourceManagementClient = new Mock <IResourceManagementClient>();

            resourceManagementClient
            .SetupGet(client => client.Providers)
            .Returns(() => this.providerOperationsMock.Object);

            this.commandRuntimeMock = new Mock <ICommandRuntime>();

            this.commandRuntimeMock
            .Setup(m => m.ShouldProcess(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(() => true);

            this.cmdlet = new UnregisterAzureProviderCmdlet
            {
                CommandRuntime  = commandRuntimeMock.Object,
                ResourcesClient = new ResourcesClient
                {
                    ResourceManagementClient = resourceManagementClient.Object
                }
            };
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GetAzureProviderCmdletTests"/> class.
        /// </summary>
        public UnregisterAzureProviderCmdletTests()
        {
            this.providerOperationsMock = new Mock<IProviderOperations>();
            var resourceManagementClient = new Mock<IResourceManagementClient>();

            resourceManagementClient
                .SetupGet(client => client.Providers)
                .Returns(() => this.providerOperationsMock.Object);

            this.commandRuntimeMock = new Mock<ICommandRuntime>();

            this.commandRuntimeMock
                .Setup(m => m.ShouldProcess(It.IsAny<string>(), It.IsAny<string>()))
                .Returns(() => true);

            this.cmdlet = new UnregisterAzureProviderCmdlet
            {
                CommandRuntime = commandRuntimeMock.Object,
                ResourcesClient = new ResourcesClient
                {
                    ResourceManagementClient = resourceManagementClient.Object
                }
            };
        }