Skip to content

Remove references to static Logger.Create. #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jmaxson-ms
Copy link
Contributor

PluginsDiscoveryOrchestrator was using Logger.Create despite having stored a logger factory.

Several other classes had constructors that default to Logger.Create as a logger factory. Rather than keeping these around, the tests that used these now pass in Logger.Create.

@@ -64,7 +65,7 @@ public async Task GetAllAsync_MissingData_ThrowsRepositoryCorruptedException()
fakeSerializer.Setup(x => x.DeserializeAsync(It.IsAny<Stream>(), It.IsAny<CancellationToken>()))
.Throws<ArgumentNullException>();

var sut = new FileBackedPluginRegistry(this.registryRoot, fakeSerializer.Object);
var sut = new FileBackedPluginRegistry(this.registryRoot, fakeSerializer.Object, Logger.Create);
Copy link
Contributor

Choose a reason for hiding this comment

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

We can extract a method for creating FileBackedPluginRegistry that will make modifying the constructor much easier in the future. Also we can avoid running the actual logging logic using Mock<ILooger>

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, I prefer having a CreateSut() method

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.

3 participants