Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Nov 14, 2024
1 parent 316bbce commit 9e38585
Showing 1 changed file with 13 additions and 7 deletions.
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;
Expand All @@ -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(() =>
Expand Down Expand Up @@ -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()));

Expand Down Expand Up @@ -278,7 +275,7 @@ public void TestNotScrolledToTopOnRemove()
[Test]
public void TestRemoveDuringLoadAndReAdd()
{
TestDelayedLoadRearrangeableList delayedList = null;
TestDelayedLoadRearrangeableList delayedList = null!;

AddStep("create list", () => Child = delayedList = new TestDelayedLoadRearrangeableList());

Expand Down Expand Up @@ -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}", () =>
Expand Down

0 comments on commit 9e38585

Please sign in to comment.