Ejemplo n.º 1
0
        public void CreateLogger_WithType_SetsLoggerNameToFullNameOfType()
        {
            var configuration = MakeLogConfiguration();
            var logService = new LogService(configuration);

            var logger = logService.Create(typeof(System.Int32));

            Assert.AreEqual(logger.Name, "System.Int32");
        }
Ejemplo n.º 2
0
        public void Write_WhenCalled_WritesItemIntoLog()
        {
            var log = new MockLog();
            var logService = new LogService(log);
            var item = Logger.CreateItem("logger name", Level.Trace, "message");

            logService.Write(item);

            Assert.AreEqual(item, log.Items[0]);
        }
Ejemplo n.º 3
0
 public void LogService_WithNullWriter_RaisesArgumentNullException()
 {
     var logService = new LogService((ILog)null);
 }
Ejemplo n.º 4
0
        public void LogService_WithNullConfiguration_UsesDefaultConfiguration()
        {
            var logService = new LogService((LogConfiguration)null);

            Assert.AreEqual(typeof(DebugLog), logService.log.GetType());
        }