mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 15:53:19 +08:00
Apply changes to tests
This commit is contained in:
parent
6d2ffe3a94
commit
1facdcf483
@ -23,51 +23,47 @@ namespace osu.Game.Tests.NonVisual
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestResultIfOnlyParentHitWindowIsEmpty()
|
public void TestResultIfOnlyParentHitWindowIsEmpty()
|
||||||
{
|
{
|
||||||
var testObject = new TestHitObject(hitWindows: HitWindows.Empty);
|
var testObject = new TestHitObject(HitWindows.Empty);
|
||||||
HitObject nested = new TestHitObject(hitWindows: new HitWindows());
|
HitObject nested = new TestHitObject(new HitWindows());
|
||||||
testObject.AddNested(nested);
|
testObject.AddNested(nested);
|
||||||
testDrawableRuleset.HitObjects = new List<HitObject> { testObject };
|
testDrawableRuleset.HitObjects = new List<HitObject> { testObject };
|
||||||
|
|
||||||
// If the parent window is empty, but its nested object isn't, return the nested object
|
|
||||||
Assert.AreSame(testDrawableRuleset.FirstAvailableHitWindows, nested.HitWindows);
|
Assert.AreSame(testDrawableRuleset.FirstAvailableHitWindows, nested.HitWindows);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestResultIfParentHitWindowsIsNotEmpty()
|
public void TestResultIfParentHitWindowsIsNotEmpty()
|
||||||
{
|
{
|
||||||
var testObject = new TestHitObject(hitWindows: new HitWindows());
|
var testObject = new TestHitObject(new HitWindows());
|
||||||
HitObject nested = new TestHitObject(hitWindows: new HitWindows());
|
HitObject nested = new TestHitObject(new HitWindows());
|
||||||
testObject.AddNested(nested);
|
testObject.AddNested(nested);
|
||||||
testDrawableRuleset.HitObjects = new List<HitObject> { testObject };
|
testDrawableRuleset.HitObjects = new List<HitObject> { testObject };
|
||||||
|
|
||||||
// If the parent window is not empty, return that immediately
|
|
||||||
Assert.AreSame(testDrawableRuleset.FirstAvailableHitWindows, testObject.HitWindows);
|
Assert.AreSame(testDrawableRuleset.FirstAvailableHitWindows, testObject.HitWindows);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestResultIfParentAndChildHitWindowsAreEmpty()
|
public void TestResultIfParentAndChildHitWindowsAreEmpty()
|
||||||
{
|
{
|
||||||
var firstObject = new TestHitObject(hitWindows: HitWindows.Empty);
|
var firstObject = new TestHitObject(HitWindows.Empty);
|
||||||
HitObject nested = new TestHitObject(hitWindows: HitWindows.Empty);
|
HitObject nested = new TestHitObject(HitWindows.Empty);
|
||||||
firstObject.AddNested(nested);
|
firstObject.AddNested(nested);
|
||||||
|
|
||||||
var secondObject = new TestHitObject(hitWindows: new HitWindows());
|
var secondObject = new TestHitObject(new HitWindows());
|
||||||
testDrawableRuleset.HitObjects = new List<HitObject> { firstObject, secondObject };
|
testDrawableRuleset.HitObjects = new List<HitObject> { firstObject, secondObject };
|
||||||
|
|
||||||
// If the parent and child windows are empty, return the next object if window isn't empty
|
|
||||||
Assert.AreSame(testDrawableRuleset.FirstAvailableHitWindows, secondObject.HitWindows);
|
Assert.AreSame(testDrawableRuleset.FirstAvailableHitWindows, secondObject.HitWindows);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestResultIfAllHitWindowsAreEmpty()
|
public void TestResultIfAllHitWindowsAreEmpty()
|
||||||
{
|
{
|
||||||
var firstObject = new TestHitObject(hitWindows: HitWindows.Empty);
|
var firstObject = new TestHitObject(HitWindows.Empty);
|
||||||
HitObject nested = new TestHitObject(hitWindows: HitWindows.Empty);
|
HitObject nested = new TestHitObject(HitWindows.Empty);
|
||||||
firstObject.AddNested(nested);
|
firstObject.AddNested(nested);
|
||||||
|
|
||||||
testDrawableRuleset.HitObjects = new List<HitObject> { firstObject };
|
testDrawableRuleset.HitObjects = new List<HitObject> { firstObject };
|
||||||
|
|
||||||
// If all windows are empty, this should return null
|
|
||||||
Assert.IsNull(testDrawableRuleset.FirstAvailableHitWindows);
|
Assert.IsNull(testDrawableRuleset.FirstAvailableHitWindows);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user