Skip to content

Commit

Permalink
fixed formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Bacher <[email protected]>
  • Loading branch information
bacherfl committed Jan 2, 2024
1 parent 8f40909 commit 9ac736a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions test/OpenFeature.Tests/OpenFeatureEventTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task Event_Executor_Should_Propagate_Events_ToGlobal_Handler()

eventExecutor.AddApiLevelHandler(ProviderEventTypes.ProviderReady, eventHandler);

var eventPayload = new Event { EventPayload = new ProviderEventPayload { Type = ProviderEventTypes.ProviderReady }};
var eventPayload = new Event { EventPayload = new ProviderEventPayload { Type = ProviderEventTypes.ProviderReady } };
eventExecutor.EventChannel.Writer.TryWrite(eventPayload);

Thread.Sleep(1000);
Expand Down Expand Up @@ -100,16 +100,12 @@ public async Task API_Level_Event_Handlers_Should_Be_Removable()
await Api.Instance.SetProvider(testProvider);

Thread.Sleep(1000);

eventHandler.Received().Invoke(Arg.Is<ProviderEventPayload>(payload => payload.ProviderName == testProvider.GetMetadata().Name));

Api.Instance.RemoveHandler(ProviderEventTypes.ProviderReady, eventHandler);

var newTestProvider = new TestProvider();
await Api.Instance.SetProvider(newTestProvider);

// now we should not receive any event since we have removed the event handler
Received.InOrder(async () => {});
eventHandler.Received(1).Invoke(Arg.Is<ProviderEventPayload>(payload => payload.ProviderName == testProvider.GetMetadata().Name));
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion test/OpenFeature.Tests/TestImplementations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public override ProviderStatus GetStatus()
public override Task Initialize(EvaluationContext context)
{
this._status = ProviderStatus.Ready;
this.EventChannel.Writer.TryWrite(new ProviderEventPayload { Type = ProviderEventTypes.ProviderReady, ProviderName = this.GetMetadata().Name});
this.EventChannel.Writer.TryWrite(new ProviderEventPayload { Type = ProviderEventTypes.ProviderReady, ProviderName = this.GetMetadata().Name });
return base.Initialize(context);
}

Expand Down

0 comments on commit 9ac736a

Please sign in to comment.