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

RegisterAzureProviderFeatureCmdletTests() public method

Initializes a new instance of the GetAzureProviderFeatureCmdletTests class.
public RegisterAzureProviderFeatureCmdletTests ( ITestOutputHelper output ) : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
output ITestOutputHelper
return Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
        public RegisterAzureProviderFeatureCmdletTests(ITestOutputHelper output)
        {
            this.featureOperationsMock = new Mock<IFeaturesOperations>();
            var featureClient = new Mock<IFeatureClient>();

            featureClient
                .SetupGet(client => client.Features)
                .Returns(() => this.featureOperationsMock.Object);

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

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

            this.cmdlet = new RegisterAzureProviderFeatureCmdlet()
            {
                //CommandRuntime = commandRuntimeMock.Object,
                ProviderFeatureClient = new ProviderFeatureClient
                {
                    FeaturesManagementClient = featureClient.Object
                }
            };
            PSCmdletExtensions.SetCommandRuntimeMock(cmdlet, commandRuntimeMock.Object);
            mockRuntime = new MockCommandRuntime();
            commandRuntimeMock.Setup(f => f.Host).Returns(mockRuntime.Host);
        }