예제 #1
0
        public void FillForegroundHorizontalLine()
        {
            var buffer = new ConsoleBuffer(5);

            buffer.FillForegroundHorizontalLine(0, 0, 5, Red, '-');
            buffer.FillForegroundHorizontalLine(1, 1, 3, Green, '=');
            buffer.FillForegroundHorizontalLine(-1, 3, 10, Blue, '_');

            var c0 = new ConsoleChar();
            var cr = new ConsoleChar {
                Char = '-', ForegroundColor = Red
            };
            var cg = new ConsoleChar {
                Char = '=', ForegroundColor = Green
            };
            var cb = new ConsoleChar {
                Char = '_', ForegroundColor = Blue
            };

            buffer.GetLine(0).Should().Equal(cr, cr, cr, cr, cr);
            buffer.GetLine(1).Should().Equal(c0, cg, cg, cg, c0);
            buffer.GetLine(2).Should().Equal(c0, c0, c0, c0, c0);
            buffer.GetLine(3).Should().Equal(cb, cb, cb, cb, cb);
        }
예제 #2
0
        public void FillForegroundHorizontalLine ()
        {
            var buffer = new ConsoleBuffer(5);

            buffer.FillForegroundHorizontalLine(0, 0, 5, Red, '-');
            buffer.FillForegroundHorizontalLine(1, 1, 3, Green, '=');
            buffer.FillForegroundHorizontalLine(-1, 3, 10, Blue, '_');

            var c0 = new ConsoleChar();
            var cr = new ConsoleChar { Char = '-', ForegroundColor = Red };
            var cg = new ConsoleChar { Char = '=', ForegroundColor = Green };
            var cb = new ConsoleChar { Char = '_', ForegroundColor = Blue };

            buffer.GetLine(0).Should().Equal(cr, cr, cr, cr, cr);
            buffer.GetLine(1).Should().Equal(c0, cg, cg, cg, c0);
            buffer.GetLine(2).Should().Equal(c0, c0, c0, c0, c0);
            buffer.GetLine(3).Should().Equal(cb, cb, cb, cb, cb);
        }