Microsoft.Azure.Commands.Resources.Test.RegisterAzureProviderCmdletTests.RegisterAzureProviderCmdletTests C# (CSharp) Method

RegisterAzureProviderCmdletTests() public method

Initializes a new instance of the RegisterAzureProviderCmdletTests class.
public RegisterAzureProviderCmdletTests ( ITestOutputHelper output ) : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
output ITestOutputHelper
return Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
        public RegisterAzureProviderCmdletTests(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 RegisterAzureProviderCmdlet()
            {
                ResourceManagerSdkClient = new ResourceManagerSdkClient
                {
                    ResourceManagementClient = resourceManagementClient.Object
                }
            };

            PSCmdletExtensions.SetCommandRuntimeMock(cmdlet, commandRuntimeMock.Object);
            mockRuntime = new MockCommandRuntime();
            commandRuntimeMock.Setup(f => f.Host).Returns(mockRuntime.Host);
        }