示例#1
0
 private void checkMutations()
 {
     AddAssert("Beatmap has correct slider multiplier", () =>
     {
         // we can only assert value correctness on TaikoMultiplierAppliedDifficulty, because that is the final difficulty converted taiko beatmaps use.
         // therefore, ensure that we have that difficulty type by calling .CopyFrom(), which is a no-op if the type is already correct.
         var taikoDifficulty = new TaikoBeatmapConverter.TaikoMultiplierAppliedDifficulty();
         taikoDifficulty.CopyFrom(editorBeatmap.Difficulty);
         return(Precision.AlmostEquals(taikoDifficulty.SliderMultiplier, 2));
     });
     AddAssert("Beatmap has correct metadata", () => editorBeatmap.BeatmapInfo.Metadata.Artist == "artist" && editorBeatmap.BeatmapInfo.Metadata.Title == "title");
     AddAssert("Beatmap has correct difficulty name", () => editorBeatmap.BeatmapInfo.DifficultyName == "difficulty");
 }
        public void TestTaikoSliderMultiplier()
        {
            AddStep("Set slider multiplier", () => EditorBeatmap.Difficulty.SliderMultiplier = 2);

            SaveEditor();

            AddAssert("Beatmap has correct slider multiplier", assertTaikoSliderMulitplier);

            ReloadEditorToSameBeatmap();

            AddAssert("Beatmap still has correct slider multiplier", assertTaikoSliderMulitplier);

            bool assertTaikoSliderMulitplier()
            {
                // we can only assert value correctness on TaikoMultiplierAppliedDifficulty, because that is the final difficulty converted taiko beatmaps use.
                // therefore, ensure that we have that difficulty type by calling .CopyFrom(), which is a no-op if the type is already correct.
                var taikoDifficulty = new TaikoBeatmapConverter.TaikoMultiplierAppliedDifficulty();

                taikoDifficulty.CopyFrom(EditorBeatmap.Difficulty);
                return(Precision.AlmostEquals(taikoDifficulty.SliderMultiplier, 2));
            }
        }