microsoft/healthcare-shared-components
Publicmirrored from https://github.com/microsoft/healthcare-shared-componentsAvailable
src/Microsoft.Health.Client.UnitTests/TestCredentialProvider.cs
25lines · modecode
| 1 | // ------------------------------------------------------------------------------------------------- |
| 2 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. |
| 4 | // ------------------------------------------------------------------------------------------------- |
| 5 | |
| 6 | using System.Threading; |
| 7 | using System.Threading.Tasks; |
| 8 | |
| 9 | namespace Microsoft.Health.Client.UnitTests |
| 10 | { |
| 11 | public class TestCredentialProvider : CredentialProvider |
| 12 | { |
| 13 | public TestCredentialProvider(string encodedToken = null) |
| 14 | { |
| 15 | EncodedToken = encodedToken; |
| 16 | } |
| 17 | |
| 18 | public string EncodedToken { get; set; } |
| 19 | |
| 20 | protected override Task<string> BearerTokenFunction(CancellationToken cancellationToken) |
| 21 | { |
| 22 | return Task.FromResult(EncodedToken); |
| 23 | } |
| 24 | } |
| 25 | } |