public void Run_WithCorruptedArgs_WithoutErrors(string[] args, string expected)
        {
            using var output = ConsoleOutputInterceptor.InterceptOutput();

            var echoApp = new EchoApplication();

            var exitCode = echoApp.Run(args);

            Assert.Equal(0, exitCode);

            var outputStr = output.ToString().NormalizeOutput();

            Assert.Equal(expected, outputStr);
        }
        public void Run_WithEmptyArgs_WithoutErrors()
        {
            using var output = ConsoleOutputInterceptor.InterceptOutput();

            var echoApp = new EchoApplication();

            var exitCode = echoApp.Run(Array.Empty <string>());

            Assert.Equal(0, exitCode);

            var outputStr = output.ToString();

            Assert.Equal(string.Empty, outputStr);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Application entry point.
        /// </summary>
        private static int Main(string[] args)
        {
            var app = new EchoApplication();

            return(app.Run(args));
        }