Exemplo n.º 1
0
        public void FillBackgroundHorizontalLine()
        {
            var buffer = new ConsoleBuffer(5);

            buffer.FillBackgroundHorizontalLine(0, 0, 5, Red);
            buffer.FillBackgroundHorizontalLine(1, 1, 3, Green);
            buffer.FillBackgroundHorizontalLine(-1, 3, 10, Blue);

            var c0 = new ConsoleChar();
            var cr = new ConsoleChar {
                BackgroundColor = Red
            };
            var cg = new ConsoleChar {
                BackgroundColor = Green
            };
            var cb = new ConsoleChar {
                BackgroundColor = 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);
        }
Exemplo n.º 2
0
        public void FillBackgroundHorizontalLine ()
        {
            var buffer = new ConsoleBuffer(5);

            buffer.FillBackgroundHorizontalLine(0, 0, 5, Red);
            buffer.FillBackgroundHorizontalLine(1, 1, 3, Green);
            buffer.FillBackgroundHorizontalLine(-1, 3, 10, Blue);

            var c0 = new ConsoleChar();
            var cr = new ConsoleChar { BackgroundColor = Red };
            var cg = new ConsoleChar { BackgroundColor = Green };
            var cb = new ConsoleChar { BackgroundColor = 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);
        }