A game framework written with osu! in mind.
at master 859 B view raw
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.Linq; 5using NUnit.Framework; 6using osu.Framework.Graphics; 7using osu.Framework.Graphics.Containers; 8using osu.Framework.Graphics.Shapes; 9using osu.Framework.Testing; 10 11namespace osu.Framework.Tests.Visual.Testing 12{ 13 public class TestSceneTestingExtensions : FrameworkTestScene 14 { 15 [Test] 16 public void TestChildrenOfTypeMatchingComposite() 17 { 18 Container container = null; 19 20 AddStep("create children", () => 21 { 22 Child = container = new Container { Child = new Box() }; 23 }); 24 25 AddAssert("ChildrenOfType returns 2 children", () => container.ChildrenOfType<Drawable>().Count() == 2); 26 } 27 } 28}