-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
@@ -21,9 +19,8 @@ namespace osu.Framework.Tests.Visual.UserInterface | |
{ | ||
public partial class TestSceneRearrangeableListContainer : ManualInputManagerTestScene | ||
{ | ||
private TestRearrangeableList list; | ||
|
||
private Container listContainer; | ||
private TestRearrangeableList list = null!; | ||
private Container listContainer = null!; | ||
|
||
[SetUp] | ||
public void Setup() => Schedule(() => | ||
|
@@ -85,7 +82,7 @@ public void TestRemoveItem() | |
|
||
addItems(item_count); | ||
|
||
List<Drawable> items = null; | ||
List<Drawable> items = null!; | ||
|
||
AddStep("get item references", () => items = new List<Drawable>(list.ItemMap.Values.ToList())); | ||
|
||
|
@@ -278,7 +275,7 @@ public void TestNotScrolledToTopOnRemove() | |
[Test] | ||
public void TestRemoveDuringLoadAndReAdd() | ||
{ | ||
TestDelayedLoadRearrangeableList delayedList = null; | ||
TestDelayedLoadRearrangeableList delayedList = null!; | ||
|
||
AddStep("create list", () => Child = delayedList = new TestDelayedLoadRearrangeableList()); | ||
|
||
|
@@ -327,6 +324,15 @@ public void TestDragSynchronisation() | |
}); | ||
} | ||
|
||
[Test] | ||
public void TestReplaceEntireList() | ||
{ | ||
addItems(1); | ||
|
||
AddStep("replace list", () => list.Items.ReplaceRange(0, list.Items.Count, [100])); | ||
AddUntilStep("wait for items to load", () => list.ItemMap.Values.All(i => i.IsLoaded)); | ||
} | ||
|
||
private void addDragSteps(int from, int to, int[] expectedSequence) | ||
{ | ||
AddStep($"move to {from}", () => | ||
|