A game framework written with osu! in mind.
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2// See the LICENCE file in the repository root for full licence text.
3
4using System;
5using NUnit.Framework;
6using osu.Framework.Graphics;
7using osu.Framework.Graphics.Containers;
8using osu.Framework.Graphics.Shapes;
9
10namespace osu.Framework.Tests.Exceptions
11{
12 [TestFixture]
13 public class TestAddRemoveExceptions
14 {
15 [Test]
16 public void TestNonStableComparer()
17 {
18 Assert.Throws<InvalidOperationException>(() =>
19 {
20 using (var broken = new BrokenFillFlowContainer())
21 {
22 var candidate = new Box();
23 var candidate2 = new Box();
24
25 broken.Add(candidate);
26 broken.Add(candidate2);
27
28 broken.Remove(candidate);
29 }
30 });
31 }
32
33 internal class BrokenFillFlowContainer : FillFlowContainer
34 {
35 protected override int Compare(Drawable x, Drawable y) => 0;
36 }
37 }
38}