public async Task GetTokenUsingAzureCliTest()
        {
            // Mock the progress manager. This emulates running an actual process e.g. az account get-access-token
            MockProcessManager mockProcessManager = new MockProcessManager(MockProcessManager.MockProcessManagerRequestType.Success);

            // AzureCliAccessTokenProvider has in internal only constructor to allow for unit testing.
            AzureCliAccessTokenProvider azureCliAccessTokenProvider = new AzureCliAccessTokenProvider(mockProcessManager);

            // Get token and validate it
            var authResult = await azureCliAccessTokenProvider.GetAuthResultAsync(Constants.KeyVaultResourceId, Constants.TenantId).ConfigureAwait(false);

            Validator.ValidateToken(authResult.AccessToken, azureCliAccessTokenProvider.PrincipalUsed, Constants.UserType, Constants.TenantId);
        }
        public async Task ResourceInvalidCharsTest()
        {
            MockProcessManager mockProcessManager = new MockProcessManager(MockProcessManager.MockProcessManagerRequestType.Success);

            AzureCliAccessTokenProvider azureCliAccessTokenProvider = new AzureCliAccessTokenProvider(mockProcessManager);

            var exception = await Assert.ThrowsAsync <AzureServiceTokenProviderException>(() => Task.Run(() => azureCliAccessTokenProvider.GetAuthResultAsync("https://test^", Constants.TenantId)));

            Assert.Contains(Constants.NotInExpectedFormatError, exception.Message);
        }
        public async Task FailedToGetTokenUsingAzureCliTest()
        {
            MockProcessManager mockProcessManager = new MockProcessManager(MockProcessManager.MockProcessManagerRequestType.Failure);

            AzureCliAccessTokenProvider azureCliAccessTokenProvider = new AzureCliAccessTokenProvider(mockProcessManager);

            var exception = await Assert.ThrowsAsync <AzureServiceTokenProviderException>(() => Task.Run(() => azureCliAccessTokenProvider.GetAuthResultAsync(Constants.KeyVaultResourceId, Constants.TenantId)));

            Assert.Contains(Constants.FailedToGetTokenError, exception.Message);
            Assert.Contains(Constants.DeveloperToolError, exception.Message);
        }
        public async Task CliNotFoundTest()
        {
            MockProcessManager mockProcessManager = new MockProcessManager(MockProcessManager.MockProcessManagerRequestType.ProcessNotFound);

            AzureCliAccessTokenProvider azureCliAccessTokenProvider = new AzureCliAccessTokenProvider(mockProcessManager);

            var exception = await Assert.ThrowsAsync <AzureServiceTokenProviderException>(() => Task.Run(() => azureCliAccessTokenProvider.GetAuthResultAsync(Constants.KeyVaultResourceId, Constants.TenantId)));

            Assert.Contains(Constants.ProgramNotFoundError, exception.Message);
        }