示例#1
0
        public void CheckGetObjectReturnsSharedInstance()
        {
            LogFactoryObject fac = new LogFactoryObject();

            fac.LogName = "Foo";
            ILog log = fac.GetObject() as ILog;
            ILog anotherLogInstance = fac.GetObject() as ILog;

            Assert.IsTrue(log == anotherLogInstance,
                          "Okay, the LogFactoryObject ain't returning shared instances (it should).");
        }
示例#2
0
        public void CheckGetObjectWorksWithValidLogName()
        {
            LogFactoryObject fac = new LogFactoryObject();

            fac.LogName = "Foo";
            ILog log = fac.GetObject() as ILog;

            Assert.IsNotNull(log, "Mmm... pulled a null ILog instance from a properly configured LogFactoryObject instance.");
        }
示例#3
0
        public void CheckThatLogNamePropertyMustBeSet()
        {
            LogFactoryObject fac = new LogFactoryObject();

            Assert.Throws <ArgumentException>(() => fac.GetObject());
        }