Ejemplo n.º 1
0
        public TestCaseSongProgress()
        {
            clock = new StopwatchClock(true);

            gameplayClock = new GameplayClock(framedClock = new FramedClock(clock));

            Add(progress = new SongProgress
            {
                RelativeSizeAxes = Axes.X,
                Anchor           = Anchor.BottomLeft,
                Origin           = Anchor.BottomLeft,
            });

            Add(graph = new TestSongProgressGraph
            {
                RelativeSizeAxes = Axes.X,
                Height           = 200,
                Anchor           = Anchor.TopLeft,
                Origin           = Anchor.TopLeft,
            });

            AddWaitStep("wait some", 5);
            AddAssert("ensure not created", () => graph.CreationCount == 0);

            AddStep("display values", displayNewValues);
            AddWaitStep("wait some", 5);
            AddUntilStep("wait for creation count", () => graph.CreationCount == 1);

            AddStep("Toggle Bar", () => progress.AllowSeeking = !progress.AllowSeeking);
            AddWaitStep("wait some", 5);
            AddUntilStep("wait for creation count", () => graph.CreationCount == 1);

            AddStep("Toggle Bar", () => progress.AllowSeeking = !progress.AllowSeeking);
            AddWaitStep("wait some", 5);
            AddUntilStep("wait for creation count", () => graph.CreationCount == 1);
            AddRepeatStep("New Values", displayNewValues, 5);

            AddWaitStep("wait some", 5);
            AddAssert("ensure debounced", () => graph.CreationCount == 2);
        }
Ejemplo n.º 2
0
        public void SetupSteps()
        {
            AddStep("add new song progress", () =>
            {
                if (progress != null)
                {
                    progress.Expire();
                    progress = null;
                }

                progressContainer.Add(progress = new SongProgress
                {
                    RelativeSizeAxes = Axes.X,
                    Anchor           = Anchor.BottomLeft,
                    Origin           = Anchor.BottomLeft,
                });
            });

            AddStep("add new big graph", () =>
            {
                if (graph != null)
                {
                    graph.Expire();
                    graph = null;
                }

                Add(graph = new TestSongProgressGraph
                {
                    RelativeSizeAxes = Axes.X,
                    Height           = 200,
                    Anchor           = Anchor.TopLeft,
                    Origin           = Anchor.TopLeft,
                });
            });

            AddStep("reset clock", clock.Reset);
        }