Esempio n. 1
0
        public void TestBeatmapBackgroundTracksBeatmap()
        {
            setSupporter(true);
            setSourceMode(BackgroundSource.Beatmap);

            AddStep("change beatmap", () => Beatmap.Value = createTestWorkingBeatmapWithUniqueBackground());
            AddAssert("background changed", () => screen.CheckLastLoadChange() == true);

            Graphics.Backgrounds.Background last = null;

            AddUntilStep("wait for beatmap background to be loaded", () => getCurrentBackground()?.GetType() == typeof(BeatmapBackground));
            AddStep("store background", () => last = getCurrentBackground());

            AddStep("change beatmap", () => Beatmap.Value = createTestWorkingBeatmapWithUniqueBackground());

            AddUntilStep("wait for beatmap background to change", () => screen.CheckLastLoadChange() == true);

            AddUntilStep("background is new beatmap background", () => last != getCurrentBackground());
            AddStep("store background", () => last = getCurrentBackground());

            AddStep("change beatmap", () => Beatmap.Value = createTestWorkingBeatmapWithUniqueBackground());

            AddUntilStep("wait for beatmap background to change", () => screen.CheckLastLoadChange() == true);
            AddUntilStep("background is new beatmap background", () => last != getCurrentBackground());
        }
Esempio n. 2
0
        public void TestBackgroundCyclingOnDefaultSkin([Values] bool supporter)
        {
            Graphics.Backgrounds.Background last = null;

            setSourceMode(BackgroundSource.Skin);
            setSupporter(supporter);
            setDefaultSkin();

            AddUntilStep("wait for beatmap background to be loaded", () => (last = getCurrentBackground())?.GetType() == typeof(Graphics.Backgrounds.Background));
            AddAssert("next cycles background", () => screen.Next());

            // doesn't really need to be checked but might as well.
            AddWaitStep("wait a bit", 5);
            AddUntilStep("ensure different background instance", () => last != getCurrentBackground());
        }
Esempio n. 3
0
        public void TestBackgroundDoesntReloadOnNoChange(BackgroundSource source, Type backgroundType)
        {
            Graphics.Backgrounds.Background last = null;

            setSourceMode(source);
            setSupporter(true);
            if (source == BackgroundSource.Skin)
            {
                setCustomSkin();
            }

            AddUntilStep("wait for beatmap background to be loaded", () => (last = getCurrentBackground())?.GetType() == backgroundType);
            AddAssert("next doesn't load new background", () => screen.Next() == false);

            // doesn't really need to be checked but might as well.
            AddWaitStep("wait a bit", 5);
            AddUntilStep("ensure same background instance", () => last == getCurrentBackground());
        }