1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 18:23:04 +08:00

Add failing tests

This commit is contained in:
smoogipoo 2021-02-02 18:01:33 +09:00
parent b9832c1b2d
commit 7c29386717

View File

@ -47,6 +47,29 @@ namespace osu.Game.Tests.Mods
Assert.That(ModUtils.CheckCompatibleSet(new[] { mod1.Object, multiMod }), Is.False); Assert.That(ModUtils.CheckCompatibleSet(new[] { mod1.Object, multiMod }), Is.False);
} }
[Test]
public void TestCompatibleMods()
{
var mod1 = new Mock<Mod>();
var mod2 = new Mock<Mod>();
// Test both orderings.
Assert.That(ModUtils.CheckCompatibleSet(new[] { mod1.Object, mod2.Object }), Is.True);
Assert.That(ModUtils.CheckCompatibleSet(new[] { mod2.Object, mod1.Object }), Is.True);
}
[Test]
public void TestIncompatibleThroughBaseType()
{
var mod1 = new Mock<Mod>();
var mod2 = new Mock<Mod>();
mod2.Setup(m => m.IncompatibleMods).Returns(new[] { mod1.Object.GetType().BaseType });
// Test both orderings.
Assert.That(ModUtils.CheckCompatibleSet(new[] { mod1.Object, mod2.Object }), Is.False);
Assert.That(ModUtils.CheckCompatibleSet(new[] { mod2.Object, mod1.Object }), Is.False);
}
[Test] [Test]
public void TestAllowedThroughMostDerivedType() public void TestAllowedThroughMostDerivedType()
{ {