示例#1
0
        public void WriteLineHappyPath2()
        {
            var mockLogger = new MockLogger(LogLevel.Warn);

            var listener = new LoggingTraceListener(mockLogger.Object, LogLevel.Info);

            listener.WriteLine("Hello, world!");

            mockLogger.VerifyInfo(Times.Never());
        }
示例#2
0
        public void WriteLineHappyPath1()
        {
            var mockLogger = new MockLogger();

            var listener = new LoggingTraceListener(mockLogger.Object, LogLevel.Info);

            listener.WriteLine("Hello, world!");

            mockLogger.VerifyInfo("^Hello, world!$", Times.Once());
        }