mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
add new test case and fix rotation not working
This commit is contained in:
62
osu.Game.Tests/Visual/TestCaseBadgeContainer.cs
Normal file
62
osu.Game.Tests/Visual/TestCaseBadgeContainer.cs
Normal file
@ -0,0 +1,62 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Overlays.Profile.Header;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCaseBadgeContainer : OsuTestCase
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(BadgeContainer) };
|
||||
|
||||
public TestCaseBadgeContainer()
|
||||
{
|
||||
BadgeContainer badgeContainer;
|
||||
|
||||
Child = badgeContainer = new BadgeContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
};
|
||||
|
||||
AddStep("Show 1 badge", () => badgeContainer.ShowBadges(new[]
|
||||
{
|
||||
new Badge
|
||||
{
|
||||
AwardedAt = DateTimeOffset.Now,
|
||||
Description = "Appreciates compasses",
|
||||
ImageUrl = "https://assets.ppy.sh/profile-badges/mg2018-1star.png",
|
||||
}
|
||||
}));
|
||||
|
||||
AddStep("Show 2 badges", () => badgeContainer.ShowBadges(new[]
|
||||
{
|
||||
new Badge
|
||||
{
|
||||
AwardedAt = DateTimeOffset.Now,
|
||||
Description = "Contributed to osu!lazer testing",
|
||||
ImageUrl = "https://assets.ppy.sh/profile-badges/contributor.png",
|
||||
},
|
||||
new Badge
|
||||
{
|
||||
AwardedAt = DateTimeOffset.Now,
|
||||
Description = "Appreciates compasses",
|
||||
ImageUrl = "https://assets.ppy.sh/profile-badges/mg2018-1star.png",
|
||||
}
|
||||
}));
|
||||
|
||||
AddStep("Show many badges", () => badgeContainer.ShowBadges(Enumerable.Range(1, 20).Select(i => new Badge
|
||||
{
|
||||
AwardedAt = DateTimeOffset.Now,
|
||||
Description = $"Contributed to osu!lazer testing {i} times",
|
||||
ImageUrl = "https://assets.ppy.sh/profile-badges/contributor.jpg",
|
||||
}).ToArray()));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user