Ejemplo n.º 1
0
        public void TestThatCommandsCanBeCompletedWithCustomClientLoop()
        {
            var input = Substitute.For <IConsoleInput>();

            var output = Substitute.For <IConsoleOutput>();

            output.BufferWidth.Returns(80);
            output.BufferHeight.Returns(25);

            var client = (ConsoleLoopClient)Loop.CreateClient(new LoopInputOutputParameters
            {
                ConsoleInput  = input,
                ConsoleOutput = output
            });

            var loop = new Loop(typeof(TestCommand), client);

            client.Reader.LineInput.ReplaceCurrentTokenWithNextCompletion(false);
            client.Reader.LineInput.Contents.Should().Be("DoSomething");
        }