Skip to content

Remove references to static Logger.Create.#386

Open
jmaxson-ms wants to merge 1 commit intomainfrom
user/jmaxson/cleanupLogging
Open

Remove references to static Logger.Create.#386
jmaxson-ms wants to merge 1 commit intomainfrom
user/jmaxson/cleanupLogging

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.

.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