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)."); }
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."); }
public void CheckThatLogNamePropertyMustBeSet() { LogFactoryObject fac = new LogFactoryObject(); Assert.Throws <ArgumentException>(() => fac.GetObject()); }