1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Add test coverage of null users in scoreboard

This commit is contained in:
Dean Herbert 2020-12-28 20:30:08 +09:00
parent 447a55ce11
commit 8f0413472c

View File

@ -90,11 +90,17 @@ namespace osu.Game.Tests.Visual.Online
};
protected override Task<User> ComputeValueAsync(int lookup, CancellationToken token = default)
=> Task.FromResult(new User
{
// tests against failed lookups
if (lookup == 13)
return Task.FromResult<User>(null);
return Task.FromResult(new User
{
Id = lookup,
Username = usernames[lookup % usernames.Length],
});
}
}
}
}