Skip to content

Commit

Permalink
Fix dotnet format build.
Browse files Browse the repository at this point in the history
Signed-off-by: André Silva <[email protected]>
  • Loading branch information
askpt committed Oct 17, 2024
1 parent 96889dd commit 54c145e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public static OpenFeatureBuilder AddContext(
Guard.ThrowIfNull(configure);

builder.IsContextConfigured = true;
builder.Services.TryAddTransient(provider => {
builder.Services.TryAddTransient(provider =>
{
var contextBuilder = EvaluationContext.Builder();
configure(contextBuilder, provider);
return contextBuilder.Build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public static IServiceCollection AddOpenFeature(this IServiceCollection services

if (builder.IsContextConfigured)
{
services.TryAddScoped<IFeatureClient>(static provider => {
services.TryAddScoped<IFeatureClient>(static provider =>
{
var api = provider.GetRequiredService<Api>();
var client = api.GetClient();
var context = provider.GetRequiredService<EvaluationContext>();
Expand All @@ -40,7 +41,8 @@ public static IServiceCollection AddOpenFeature(this IServiceCollection services
}
else
{
services.TryAddScoped<IFeatureClient>(static provider => {
services.TryAddScoped<IFeatureClient>(static provider =>
{
var api = provider.GetRequiredService<Api>();
return api.GetClient();
});
Expand Down
2 changes: 1 addition & 1 deletion src/OpenFeature.Hosting/FeatureStartState.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature;
namespace OpenFeature;

/// <summary>
/// Defines the various states for starting a feature.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenFeature.Hosting/FeatureStopState.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature;
namespace OpenFeature;

/// <summary>
/// Defines the various states for stopping a feature.
Expand Down
5 changes: 3 additions & 2 deletions src/OpenFeature.Hosting/OpenFeatureBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ public static partial class OpenFeatureBuilderExtensions
/// <returns>The <see cref="OpenFeatureBuilder"/> instance.</returns>
public static OpenFeatureBuilder AddHostedFeatureLifecycle(this OpenFeatureBuilder builder, Action<FeatureLifecycleStateOptions>? configureOptions = null)
{
if(configureOptions == null)
if (configureOptions == null)
{
builder.Services.Configure<FeatureLifecycleStateOptions>(cfg => {
builder.Services.Configure<FeatureLifecycleStateOptions>(cfg =>
{
cfg.StartState = FeatureStartState.Starting;
cfg.StopState = FeatureStopState.Stopping;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task EnsureInitializedAsync_ShouldLogAndSetProvider_WhenProviderExi
.Returns(featureProvider);

// Act
await _systemUnderTest.EnsureInitializedAsync();
await _systemUnderTest.EnsureInitializedAsync().ConfigureAwait(true);

// Assert
Api.Instance.GetProvider().Should().BeSameAs(featureProvider);
Expand All @@ -49,7 +49,7 @@ public async Task EnsureInitializedAsync_ShouldThrowException_WhenProviderDoesNo
var act = () => _systemUnderTest.EnsureInitializedAsync().AsTask();

// Assert
var exception = await Assert.ThrowsAsync<InvalidOperationException>(act);
var exception = await Assert.ThrowsAsync<InvalidOperationException>(act).ConfigureAwait(true);
exception.Message.Should().Be("Feature provider is not registered in the service collection.");
}
}

0 comments on commit 54c145e

Please sign in to comment.