Пример #1
0
        public void FormatCaller_Message()
        {
            // Prepare
            const string memberName = "FormatCaller_Message";
            const string sourceFilePath = "Log4NetUnitTest.cs";
            const int sourceLineNumber = 45;
            const string format = "File: {0,50} Method:{1,40}";
            logger.SetupGet(o => o.IsDebugEnabled).Returns(() => true);
            log = new Log4NetLogger(logger.Object);

            // Act
            var result = log.FormatCallerMessage(memberName,sourceFilePath,sourceLineNumber);

            // Assert
            Assert.That(result.Contains(string.Format(format,sourceFilePath,memberName)));
        }
Пример #2
0
        public void FormatCaller_Message()
        {
            // Prepare
            const string memberName       = "FormatCaller_Message";
            const string sourceFilePath   = "Log4NetUnitTest.cs";
            const int    sourceLineNumber = 45;
            const string format           = "File: {0,50} Method:{1,40}";

            logger.SetupGet(o => o.IsDebugEnabled).Returns(() => true);
            log = new Log4NetLogger(logger.Object);

            // Act
            var result = log.FormatCallerMessage(memberName, sourceFilePath, sourceLineNumber);

            // Assert
            Assert.That(result.Contains(string.Format(format, sourceFilePath, memberName)));
        }