mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 02:42:54 +08:00
Fix chat tests failing 1/10000 runs
31a447fda0/osu.Game/Online/Chat/ChannelManager.cs (L412-L414)
Sigh.
This commit is contained in:
parent
2b278ed324
commit
13dcaf82ad
@ -549,7 +549,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
|
|
||||||
private Channel createPrivateChannel()
|
private Channel createPrivateChannel()
|
||||||
{
|
{
|
||||||
int id = RNG.Next(0, 10000);
|
int id = RNG.Next(0, DummyAPIAccess.DUMMY_USER_ID - 1);
|
||||||
return new Channel(new APIUser
|
return new Channel(new APIUser
|
||||||
{
|
{
|
||||||
Id = id,
|
Id = id,
|
||||||
@ -559,7 +559,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
|
|
||||||
private Channel createAnnounceChannel()
|
private Channel createAnnounceChannel()
|
||||||
{
|
{
|
||||||
int id = RNG.Next(0, 10000);
|
int id = RNG.Next(0, DummyAPIAccess.DUMMY_USER_ID - 1);
|
||||||
return new Channel
|
return new Channel
|
||||||
{
|
{
|
||||||
Name = $"Announce {id}",
|
Name = $"Announce {id}",
|
||||||
|
@ -15,10 +15,12 @@ namespace osu.Game.Online.API
|
|||||||
{
|
{
|
||||||
public class DummyAPIAccess : Component, IAPIProvider
|
public class DummyAPIAccess : Component, IAPIProvider
|
||||||
{
|
{
|
||||||
|
public const int DUMMY_USER_ID = 1001;
|
||||||
|
|
||||||
public Bindable<APIUser> LocalUser { get; } = new Bindable<APIUser>(new APIUser
|
public Bindable<APIUser> LocalUser { get; } = new Bindable<APIUser>(new APIUser
|
||||||
{
|
{
|
||||||
Username = @"Dummy",
|
Username = @"Dummy",
|
||||||
Id = 1001,
|
Id = DUMMY_USER_ID,
|
||||||
});
|
});
|
||||||
|
|
||||||
public BindableList<APIUser> Friends { get; } = new BindableList<APIUser>();
|
public BindableList<APIUser> Friends { get; } = new BindableList<APIUser>();
|
||||||
|
Loading…
Reference in New Issue
Block a user