-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: test data setup as named user (#58)
+semver: feature
- Loading branch information
Showing
39 changed files
with
1,020 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
bindings/src/Capgemini.PowerApps.SpecFlowBindings/Configuration/ClientCredentials.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace Capgemini.PowerApps.SpecFlowBindings.Configuration | ||
{ | ||
using YamlDotNet.Serialization; | ||
|
||
/// <summary> | ||
/// Configuration for the test application user. | ||
/// </summary> | ||
public class ClientCredentials | ||
{ | ||
private string tenantId; | ||
private string clientId; | ||
private string clientSecret; | ||
|
||
/// <summary> | ||
/// Gets or sets the tenant ID of the test application user app registration. | ||
/// </summary> | ||
[YamlMember(Alias = "tenantId")] | ||
public string TenantId { get => ConfigHelper.GetEnvironmentVariableIfExists(this.tenantId); set => this.tenantId = value; } | ||
|
||
/// <summary> | ||
/// Gets or sets the client ID of the test application user app registration. | ||
/// </summary> | ||
[YamlMember(Alias = "clientId")] | ||
public string ClientId { get => ConfigHelper.GetEnvironmentVariableIfExists(this.clientId); set => this.clientId = value; } | ||
|
||
/// <summary> | ||
/// Gets or sets a client secret or the name of an environment variable containing the client secret of the test application user app registration. | ||
/// </summary> | ||
[YamlMember(Alias = "clientSecret")] | ||
public string ClientSecret { get => ConfigHelper.GetEnvironmentVariableIfExists(this.clientSecret); set => this.clientSecret = value; } | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
bindings/src/Capgemini.PowerApps.SpecFlowBindings/Configuration/ConfigHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace Capgemini.PowerApps.SpecFlowBindings.Configuration | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// Helper methods for configuration classes. | ||
/// </summary> | ||
public static class ConfigHelper | ||
{ | ||
/// <summary> | ||
/// Returns the value of an environment variable if it exists. Alternatively, returns the passed in value. | ||
/// </summary> | ||
/// <param name="value">The value which may be the name of an environment variable.</param> | ||
/// <returns>The environment variable value (if found) or the passed in value.</returns> | ||
public static string GetEnvironmentVariableIfExists(string value) | ||
{ | ||
var environmentVariableValue = Environment.GetEnvironmentVariable(value); | ||
|
||
if (!string.IsNullOrEmpty(environmentVariableValue)) | ||
{ | ||
return environmentVariableValue; | ||
} | ||
|
||
return value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.