2018-05-29 14:53:30 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2018-12-22 13:01:06 +08:00
|
|
|
|
using System.Collections.Generic;
|
2018-05-29 14:53:30 +08:00
|
|
|
|
using NUnit.Framework;
|
2018-12-22 13:01:06 +08:00
|
|
|
|
using osu.Framework.Configuration;
|
2018-05-29 14:53:30 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2018-12-10 18:20:41 +08:00
|
|
|
|
using osu.Game.Screens.Multi.Match.Components;
|
2018-05-29 14:53:30 +08:00
|
|
|
|
using osu.Game.Users;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class TestCaseMatchParticipants : OsuTestCase
|
|
|
|
|
{
|
2018-12-22 13:01:06 +08:00
|
|
|
|
private readonly Bindable<int?> maxParticipants = new Bindable<int?>();
|
|
|
|
|
private readonly Bindable<IEnumerable<User>> users = new Bindable<IEnumerable<User>>();
|
|
|
|
|
|
2018-05-29 14:53:30 +08:00
|
|
|
|
public TestCaseMatchParticipants()
|
|
|
|
|
{
|
|
|
|
|
Participants participants;
|
|
|
|
|
|
2018-12-22 13:01:06 +08:00
|
|
|
|
Add(participants = new Participants { RelativeSizeAxes = Axes.Both });
|
|
|
|
|
|
|
|
|
|
participants.MaxParticipants.BindTo(maxParticipants);
|
|
|
|
|
participants.Users.BindTo(users);
|
|
|
|
|
|
|
|
|
|
AddStep(@"set max to null", () => maxParticipants.Value = null);
|
|
|
|
|
AddStep(@"set users", () => users.Value = new[]
|
2018-05-29 14:53:30 +08:00
|
|
|
|
{
|
|
|
|
|
new User
|
|
|
|
|
{
|
|
|
|
|
Username = @"Feppla",
|
|
|
|
|
Id = 4271601,
|
|
|
|
|
Country = new Country { FlagName = @"SE" },
|
|
|
|
|
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c2.jpg",
|
|
|
|
|
IsSupporter = true,
|
|
|
|
|
},
|
|
|
|
|
new User
|
|
|
|
|
{
|
|
|
|
|
Username = @"Xilver",
|
|
|
|
|
Id = 3099689,
|
|
|
|
|
Country = new Country { FlagName = @"IL" },
|
|
|
|
|
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c2.jpg",
|
|
|
|
|
IsSupporter = true,
|
|
|
|
|
},
|
|
|
|
|
new User
|
|
|
|
|
{
|
|
|
|
|
Username = @"Wucki",
|
|
|
|
|
Id = 5287410,
|
|
|
|
|
Country = new Country { FlagName = @"FI" },
|
|
|
|
|
CoverUrl = @"https://assets.ppy.sh/user-profile-covers/5287410/5cfeaa9dd41cbce038ecdc9d781396ed4b0108089170bf7f50492ef8eadeb368.jpeg",
|
|
|
|
|
IsSupporter = true,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2018-12-22 13:01:06 +08:00
|
|
|
|
AddStep(@"set max", () => maxParticipants.Value = 10);
|
|
|
|
|
AddStep(@"clear users", () => users.Value = new User[] { });
|
|
|
|
|
AddStep(@"set max to null", () => maxParticipants.Value = null);
|
2018-05-29 14:53:30 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|