コード例 #1
0
        public string getOutputFromInput(string input)
        {
            var originalConsoleOut = Console.Out;
            var originalConsoleIn  = Console.In;

            StringWriter mockedOut = new StringWriter();
            StringReader mockedIn  = new StringReader(input);

            Console.SetOut(mockedOut);
            Console.SetIn(mockedIn);

            AlphaApp alphaApp = new AlphaApp();

            alphaApp.run();
            return(mockedOut.ToString());
        }
コード例 #2
0
        public static void Main(string[] args)
        {
            App app = new AlphaApp();

            app.run();
        }