public void ShouldReturnLogFactoryByName() { var logFactoryRegistry = new LogFactoryRegistry(); var mylogger = new Mock<ITaskLogFactory>().Object; logFactoryRegistry.RegisterLogFactory("mylogger", mylogger); Assert.That(logFactoryRegistry.GetLogFactoryByName("mylogger"), Is.SameAs(mylogger)); }
public void ThrowsExceptionIfLoggerNotFoundByName() { var logFactoryRegistry = new LogFactoryRegistry(); Assert.That(() => logFactoryRegistry.GetLogFactoryByName("mylogger"), Throws.InstanceOf(typeof(ConfigurationException))); }
public void ThrowsExceptionIfLoggerNotFoundByName() { var logFactoryRegistry = new LogFactoryRegistry(); Assert.That(() => logFactoryRegistry.GetLogFactoryByName("mylogger"), Throws.InstanceOf(typeof (ConfigurationException))); }
public void ShouldReturnLogFactoryByName() { var logFactoryRegistry = new LogFactoryRegistry(); var mylogger = new Mock <ITaskLogFactory>().Object; logFactoryRegistry.RegisterLogFactory("mylogger", mylogger); Assert.That(logFactoryRegistry.GetLogFactoryByName("mylogger"), Is.SameAs(mylogger)); }