Exemplo n.º 1
1
        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));
        }
Exemplo n.º 2
0
        public void ThrowsExceptionIfLoggerNotFoundByName()
        {
            var logFactoryRegistry = new LogFactoryRegistry();

            Assert.That(() => logFactoryRegistry.GetLogFactoryByName("mylogger"),
                        Throws.InstanceOf(typeof(ConfigurationException)));
        }
Exemplo n.º 3
0
        public void ThrowsExceptionIfLoggerNotFoundByName()
        {
            var logFactoryRegistry = new LogFactoryRegistry();

            Assert.That(() => logFactoryRegistry.GetLogFactoryByName("mylogger"),
                        Throws.InstanceOf(typeof (ConfigurationException)));
        }
Exemplo n.º 4
0
        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));
        }