Exemplo n.º 1
0
        public void TestTextBoxBlinkState()
        {
            var app = new CliTestHarness(this.TestContext, 9, 1);

            app.Invoke(() =>
            {
                app.LayoutRoot.Add(new TextBox()
                {
                    Value = "SomeText".ToWhite()
                }).Fill();
                app.SetTimeout(() => app.Stop(), TimeSpan.FromSeconds(1.2));
            });
            app.Start().Wait();
            app.AssertThisTestMatchesLKG();
        }
Exemplo n.º 2
0
        public void TestThreeMonthCalendarBasicRender()
        {
            var app = new CliTestHarness(this.TestContext, 120, 40);

            app.Invoke(async() =>
            {
                var carousel = new ThreeMonthCarousel(new ThreeMonthCarouselOptions()
                {
                    Month = 1, Year = 2000
                });
                var start = carousel.Options.Month + "/" + carousel.Options.Year;
                app.LayoutRoot.Add(new FixedAspectRatioPanel(4f / 1f, carousel)).Fill();
                Assert.IsTrue(await carousel.SeekAsync(true, carousel.Options.AnimationDuration));
                await Task.Delay(1000);
                Assert.IsTrue(await carousel.SeekAsync(true, carousel.Options.AnimationDuration));
                await Task.Delay(1000);
                Assert.IsTrue(await carousel.SeekAsync(true, carousel.Options.AnimationDuration));
                await Task.Delay(1000);
                Assert.IsTrue(await carousel.SeekAsync(true, carousel.Options.AnimationDuration));

                await Task.Delay(3000);

                var now = carousel.Options.Month + "/" + carousel.Options.Year;
                Assert.AreNotEqual(start, now);

                Assert.IsTrue(await carousel.SeekAsync(false, carousel.Options.AnimationDuration));
                await Task.Delay(1000);
                Assert.IsTrue(await carousel.SeekAsync(false, carousel.Options.AnimationDuration));
                await Task.Delay(1000);
                Assert.IsTrue(await carousel.SeekAsync(false, carousel.Options.AnimationDuration));
                await Task.Delay(1000);
                Assert.IsTrue(await carousel.SeekAsync(false, carousel.Options.AnimationDuration));
                await Task.Delay(1000);

                now = carousel.Options.Month + "/" + carousel.Options.Year;
                Assert.AreEqual(start, now);
                app.Stop();
            });
            app.Run();
            app.AssertThisTestMatchesLKGFirstAndLastFrame();
        }