This commit is contained in:
smoogipoo 2020-12-10 00:32:31 +09:00
parent 47a93d8614
commit 9835245ea2
1 changed files with 21 additions and 0 deletions

View File

@ -68,12 +68,29 @@ public void TestDeserialiseTimeRampMod()
Assert.That(converted.FinalRate.Value, Is.EqualTo(0.25));
}
[Test]
public void TestDeserialiseDifficultyAdjustModWithExtendedLimits()
{
var apiMod = new APIMod(new TestModDifficultyAdjust
{
OverallDifficulty = { Value = 11 },
ExtendedLimits = { Value = true }
});
var deserialised = JsonConvert.DeserializeObject<APIMod>(JsonConvert.SerializeObject(apiMod));
var converted = (TestModDifficultyAdjust)deserialised.ToMod(new TestRuleset());
Assert.That(converted.ExtendedLimits.Value, Is.True);
Assert.That(converted.OverallDifficulty.Value, Is.EqualTo(11));
}
private class TestRuleset : Ruleset
{
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[]
{
new TestMod(),
new TestModTimeRamp(),
new TestModDifficultyAdjust()
};
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) => throw new System.NotImplementedException();
@ -135,5 +152,9 @@ private class TestModTimeRamp : ModTimeRamp
Value = true
};
}
private class TestModDifficultyAdjust : ModDifficultyAdjust
{
}
}
}