public void Factories_NamedLoggerFactoryBase_Requesting_Loggers_By_Different_Names_Returns_Different_Instances() { NamedLoggerFactoryBase target = new TestNamedLoggerFactory(); ILogger logger = target.GetLogger("foo"); ILogger loggerTwo = target.GetLogger("foo.bar"); Assert.AreNotSame(logger, loggerTwo); }
public void Factories_NamedLoggerFactoryBase_GetLogger_WithSameNameCaseInsensitive_ReturnsSameInstance() { NamedLoggerFactoryBase target = new TestNamedLoggerFactory(); ILogger logger = target.GetLogger("foo"); ILogger loggerTwo = target.GetLogger("FOO"); Assert.AreSame(logger, loggerTwo); }
public void Factories_NamedLoggerFactoryBase_GetLogger_With_Null_Uses_Default_Name() { NamedLoggerFactoryBase target = new TestNamedLoggerFactory(); var logger = target.GetLogger(null); Assert.AreEqual(string.Empty, logger.Name); }
public void Factories_NamedLoggerFactoryBase_GetLogger_ReturnsLoggerWithGivenName() { NamedLoggerFactoryBase target = new TestNamedLoggerFactory(); ILogger logger = target.GetLogger("foo"); Assert.AreEqual("foo", logger.Name); }
public void Factories_NamedLoggerFactoryBase_GetLogger_WithDifferentNames_ReturnsLoggerWithGivenNames() { NamedLoggerFactoryBase target = new TestNamedLoggerFactory(); string name1 = "foo"; string name2 = "foo.bar"; ILogger logger1 = target.GetLogger(name1); ILogger logger2 = target.GetLogger(name2); Assert.AreEqual(name1, logger1.Name); Assert.AreEqual(name2, logger2.Name); logger2 = target.GetLogger(name1); Assert.AreEqual(logger1, logger2); logger1 = target.GetLogger(name2); logger2 = target.GetLogger(name2); Assert.AreEqual(logger1, logger2); }