コード例 #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));
        }
コード例 #2
0
        public void ThrowsExceptionIfLoggerNotFoundByName()
        {
            var logFactoryRegistry = new LogFactoryRegistry();

            Assert.That(() => logFactoryRegistry.GetLogFactoryByName("mylogger"),
                        Throws.InstanceOf(typeof(ConfigurationException)));
        }
コード例 #3
0
        public void ThrowsExceptionIfLoggerNotFoundByName()
        {
            var logFactoryRegistry = new LogFactoryRegistry();

            Assert.That(() => logFactoryRegistry.GetLogFactoryByName("mylogger"),
                        Throws.InstanceOf(typeof (ConfigurationException)));
        }
コード例 #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));
        }