예제 #1
0
        public void TestDrawRect()
        {
            var bitmap = new ConsoleBitmap(80, 30);
            var app    = new CliTestHarness(TestContext, bitmap.Width, bitmap.Height, true);

            app.InvokeNextCycle(async() =>
            {
                app.LayoutRoot.Add(new BitmapControl()
                {
                    Bitmap = bitmap
                }).Fill();
                var pen = new ConsoleCharacter('X', ConsoleColor.Green);
                for (var i = 0; i < 500000; i++)
                {
                    bitmap.DrawRect(pen, 0, 0, bitmap.Width, bitmap.Height);
                }
                await app.PaintAndRecordKeyFrameAsync();
                app.Stop();
            });

            app.Start().Wait();
            app.AssertThisTestMatchesLKG();
        }