Пример #1
0
        public static void TestExtraObjParams()
        {
            LogMessage message = new LogMessage("Hi: {0} ", LogLevel.Error, typeof(LogMessageTests), 2, 3, 4, "TestingBlah");

            Console.WriteLine(message.BuildMessage());
            Assert.IsTrue(message.BuildMessage().Contains("Hi: 2"));
            Assert.IsFalse(message.BuildMessage().Contains("TestingBlah"));
        }
Пример #2
0
        public static void TestBuildMessageNoParams()
        {
            LogMessage message = new LogMessage("Hi: Blah", LogLevel.Error, typeof(LogMessageTests));

            Console.WriteLine(message.BuildMessage());
            Assert.IsTrue(message.BuildMessage().Contains("Hi: Blah"));
            Assert.IsTrue(message.BuildMessage().Contains(typeof(LogMessageTests).ToString()));
            Assert.IsTrue(message.BuildMessage().Contains(message.Level.ToString()));
        }
Пример #3
0
        public static void TestInvalidSizeOfObjParams()
        {
            LogMessage message = new LogMessage("Hi: {0} {1}", LogLevel.Error, typeof(LogMessageTests), 2);

            Console.WriteLine(message.BuildMessage());
        }
Пример #4
0
        public static void TestBuildMessageWithoutParamsButExpectingParams()
        {
            LogMessage message = new LogMessage("Hi: {0}", LogLevel.Error, typeof(LogMessageTests));

            Console.WriteLine(message.BuildMessage());
        }