コード例 #1
0
        public void TestKeyEqualsWithDifferentModOrder()
        {
            var key1 = new BeatmapDifficultyCache.DifficultyCacheLookup(new BeatmapInfo {
                ID = guid
            }, new RulesetInfo {
                OnlineID = 0
            }, new Mod[] { new OsuModHardRock(), new OsuModHidden() });
            var key2 = new BeatmapDifficultyCache.DifficultyCacheLookup(new BeatmapInfo {
                ID = guid
            }, new RulesetInfo {
                OnlineID = 0
            }, new Mod[] { new OsuModHidden(), new OsuModHardRock() });

            Assert.That(key1, Is.EqualTo(key2));
            Assert.That(key1.GetHashCode(), Is.EqualTo(key2.GetHashCode()));
        }
コード例 #2
0
        public void TestKeyEqualWithMatchingModSettings()
        {
            var key1 = new BeatmapDifficultyCache.DifficultyCacheLookup(new BeatmapInfo {
                ID = guid
            }, new RulesetInfo {
                OnlineID = 0
            }, new Mod[] { new OsuModDoubleTime {
                               SpeedChange = { Value = 1.25 }
                           } });
            var key2 = new BeatmapDifficultyCache.DifficultyCacheLookup(new BeatmapInfo {
                ID = guid
            }, new RulesetInfo {
                OnlineID = 0
            }, new Mod[] { new OsuModDoubleTime {
                               SpeedChange = { Value = 1.25 }
                           } });

            Assert.That(key1, Is.EqualTo(key2));
            Assert.That(key1.GetHashCode(), Is.EqualTo(key2.GetHashCode()));
        }
コード例 #3
0
        public void TestKeyDoesntEqualWithDifferentModSettings()
        {
            var key1 = new BeatmapDifficultyCache.DifficultyCacheLookup(new BeatmapInfo {
                ID = 1234
            }, new RulesetInfo {
                OnlineID = 0
            }, new Mod[] { new OsuModDoubleTime {
                               SpeedChange = { Value = 1.1 }
                           } });
            var key2 = new BeatmapDifficultyCache.DifficultyCacheLookup(new BeatmapInfo {
                ID = 1234
            }, new RulesetInfo {
                OnlineID = 0
            }, new Mod[] { new OsuModDoubleTime {
                               SpeedChange = { Value = 1.9 }
                           } });

            Assert.That(key1, Is.Not.EqualTo(key2));
            Assert.That(key1.GetHashCode(), Is.Not.EqualTo(key2.GetHashCode()));
        }