-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I hope I understood the meaning of this extension correctly. I would expect to get a different logger for every class that is resolved and needs an ILogger. Currently only the first resolve leads to a new ILogger-object which is passed to all other classes that also need an ILogger.
From my understanding the following test should result in two different loggerinstances but the test fails as they are the same (just paste it into the existing test class, I was unsure if I should have made this a pull-request since I could not provide a solution):
[TestMethod]
public void NLog_different()
{
LoggedType2 instance2 = _container.Resolve<LoggedType2>();
Assert.AreNotSame(instance2.Logger,
_instance.Logger);
}
public class LoggedType2
{
public LoggedType2(ILogger log)
{
Logger = log;
}
public ILogger Logger { get; }
}
I hope I made this issue clear enough as I am fairly new to Unity.
KifKot
Metadata
Metadata
Assignees
Labels
No labels