Ejemplo n.º 1
0
        /// <summary>
        /// Helper routine to setup the log.
        /// </summary>
        /// <param name="logFunc">Logging function under test.</param>
        /// <returns>The string logged in uppercase.</returns>
        public static string LogHarness(Action <IExecutionLog> logFunc)
        {
            if (logFunc == null)
            {
                throw new ArgumentNullException("logFunc");
            }

            using (var fakeConsole = new FakeConsole())
            {
                var log = new ConsoleExecutionLog();
                logFunc(log);

                var logged = fakeConsole.OutValue;
                return(logged.ToUpperInvariant());
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Helper routine to setup the log.
        /// </summary>
        /// <param name="logFunc">Logging function under test.</param>
        /// <returns>The string logged in uppercase.</returns>
        public static string LogHarness(Action<IExecutionLog> logFunc)
        {
            if (logFunc == null)
            {
                throw new ArgumentNullException("logFunc");
            }

            using (var fakeConsole = new FakeConsole())
            {
                var log = new ConsoleExecutionLog();
                logFunc(log);

                var logged = fakeConsole.OutValue;
                return logged.ToUpperInvariant();
            }
        }