Skip to content

Commit db32f34

Browse files
committed
Visual test for KeyCounter.
1 parent 10c2039 commit db32f34

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using OpenTK.Input;
3+
using osu.Framework.GameModes.Testing;
4+
using osu.Game.Graphics.UserInterface;
5+
6+
namespace osu.Desktop.Tests
7+
{
8+
class TestCaseKeyCounter : TestCase
9+
{
10+
public override string Name => @"KeyCounter";
11+
12+
public override string Description => @"Tests key counter";
13+
14+
public override void Reset()
15+
{
16+
base.Reset();
17+
18+
KeyCounter kc = new KeyCounter { IsCounting = true };
19+
Add(kc);
20+
kc.AddKey(new KeyBoardCount(@"Z", Key.Z));
21+
kc.AddKey(new KeyBoardCount(@"X", Key.X));
22+
kc.AddKey(new MouseCount(@"M1", MouseButton.Left));
23+
kc.AddKey(new MouseCount(@"M2", MouseButton.Right));
24+
}
25+
}
26+
}

osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
</ItemGroup>
149149
<ItemGroup>
150150
<Compile Include="Program.cs" />
151+
<Compile Include="Tests\TestCaseKeyCounter.cs" />
151152
<Compile Include="Tests\TestCaseTextAwesome.cs" />
152153
<Compile Include="VisualTestGame.cs" />
153154
</ItemGroup>

0 commit comments

Comments
 (0)