Skip to content

Commit

Permalink
feat: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
davejohnston committed Nov 21, 2023
1 parent a1f9ca7 commit a03f377
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/OpenFeature.Contrib.Providers.Harness/HarnessAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static ResolutionDetails<T> HarnessResponse<T>(string flagKey, T defaultV
flagKey,
defaultValue);
}

/// <summary>
/// Convert the OpenFeature EvaluationContext to a harness target.
/// </summary>
Expand All @@ -41,13 +41,13 @@ public static Target CreateTarget(EvaluationContext context)
{
return null;
}

// Get the name, if it is missing or empty return null
if (context.TryGetValue("name", out var name) != true || name.IsString != true)
{
return null;
}

// Create a target (different targets can get different results based on rules)
// TODO we need to deal with target attributes
// .Attributes(new Dictionary<string, string>(){{"email", "[email protected]"}})
Expand All @@ -56,8 +56,8 @@ public static Target CreateTarget(EvaluationContext context)
.Identifier(identifier.AsString)
.build();
return target;

}


}
10 changes: 5 additions & 5 deletions src/OpenFeature.Contrib.Providers.Harness/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ public class Provider : FeatureProvider
{
private const string HarnessProviderName = "Harness Provider";

private readonly Metadata _metadata = new (HarnessProviderName);
private readonly Metadata _metadata = new(HarnessProviderName);
private readonly ICfClient _client;

/// <summary>
/// Constructor of the Harness provider.
/// </summary>
public Provider(ICfClient client)
{
_client = client;
}

/// <inheritdoc/>
public override Metadata GetMetadata()
{
return this._metadata;
}

/// <inheritdoc/>
public override Task<ResolutionDetails<bool>> ResolveBooleanValue(string flagKey, bool defaultValue, EvaluationContext context = null)
{
Expand Down Expand Up @@ -60,7 +60,7 @@ public override Task<ResolutionDetails<double>> ResolveDoubleValue(string flagKe

/// <inheritdoc/>
public override Task<ResolutionDetails<Value>> ResolveStructureValue(string flagKey, Value defaultValue, EvaluationContext context = null)
{
{
// TODO need to implement this
return Task.FromResult(HarnessAdapter.HarnessResponse(flagKey, defaultValue));
}
Expand Down

0 comments on commit a03f377

Please sign in to comment.