Skip to content

Akka.Hosting.TestKit: added NullScope to xUnitLogger - #570

Merged
Arkatufus merged 1 commit into
akkadotnet:devfrom
Aaronontheweb:xunit-logger-scope
Feb 5, 2025
Merged

Akka.Hosting.TestKit: added NullScope to xUnitLogger#570
Arkatufus merged 1 commit into
akkadotnet:devfrom
Aaronontheweb:xunit-logger-scope

Conversation

@Aaronontheweb

@Aaronontheweb Aaronontheweb commented Feb 5, 2025

Copy link
Copy Markdown
Member

Changes

This prevents a NotImplementedException from being thrown inside some test cases when working with other components that depend on scopes via Microsoft.Extensions.Logging

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

This prevents a `NotImplementedException` from being thrown inside some test cases when working with other components that depend on scopes via Microsoft.Extensions.Logging
public IDisposable BeginScope<TState>(TState state)
{
throw new NotImplementedException();
return NullScope.Instance;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't alter behavior, just stops the throw

@Arkatufus Arkatufus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants