コード例 #1
0
 public ConsoleMock()
 {
     _consoleManager = new ConsoleIOManager();
     _defaultIn      = Console.In;
     _defaultOut     = Console.Out;
     Console.SetIn(new InputManager(_consoleManager));
     Console.SetOut(new OutputManager(_consoleManager, Console.OutputEncoding));
     PatchConsole();
 }
コード例 #2
0
 public InputManager(ConsoleIOManager consoleManager)
 {
     _consoleManager = consoleManager;
 }
コード例 #3
0
 public OutputManager(ConsoleIOManager consoleManager, Encoding encoding)
 {
     _consoleManager = consoleManager;
     _encoding       = encoding;
 }