Exemplo n.º 1
0
        public void TestGetPlayableRulesetLoadFailure()
        {
            var working = new TestWorkingBeatmap(new Beatmap());

            // by default mocks return nulls if not set up, which is actually desired here to simulate a ruleset load failure scenario.
            var ruleset = new Mock <IRulesetInfo>();

            Assert.Throws <RulesetLoadException>(() => working.GetPlayableBeatmap(ruleset.Object));
        }
Exemplo n.º 2
0
        private WorkingBeatmap getBeatmap(string name)
        {
            using (var resStream = openResource($"{resource_namespace}.{name}.osu"))
                using (var stream = new LineBufferedReader(resStream))
                {
                    var decoder = Decoder.GetDecoder <Beatmap>(stream);
                    ((LegacyBeatmapDecoder)decoder).ApplyOffsets = false;

                    var working = new TestWorkingBeatmap(decoder.Decode(stream));
                    working.BeatmapInfo.Ruleset = CreateRuleset().RulesetInfo;

                    return(working);
                }
        }