More anonymising in tests

This commit is contained in:
iiSaLMaN 2019-06-27 07:48:57 +03:00 committed by KingLuigi4932
parent 3294464bc6
commit e78ecb9757
2 changed files with 82 additions and 274 deletions

View File

@ -92,144 +92,37 @@ namespace osu.Game.Tests.Visual.Online
OnlineInfo = new BeatmapSetOnlineInfo OnlineInfo = new BeatmapSetOnlineInfo
{ {
Preview = @"https://b.ppy.sh/preview/12345.mp3", Preview = @"https://b.ppy.sh/preview/12345.mp3",
PlayCount = 681380, PlayCount = 123,
FavouriteCount = 356, FavouriteCount = 456,
Submitted = new DateTime(2016, 2, 10), Submitted = DateTime.Now,
Ranked = new DateTime(2016, 6, 19), Ranked = DateTime.Now,
Status = BeatmapSetOnlineStatus.Ranked, BPM = 111,
BPM = 236,
HasVideo = true, HasVideo = true,
Covers = new BeatmapSetOnlineCovers HasStoryboard = true,
{ Covers = new BeatmapSetOnlineCovers(),
Cover = @"https://assets.ppy.sh/beatmaps/415886/covers/cover.jpg?1465651778",
},
}, },
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() }, Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() },
Beatmaps = new List<BeatmapInfo> Beatmaps = new List<BeatmapInfo>
{ {
new BeatmapInfo new BeatmapInfo
{ {
StarDifficulty = 1.36, StarDifficulty = 9.99,
Version = @"BASIC", Version = @"TEST",
Ruleset = maniaRuleset, Ruleset = maniaRuleset,
BaseDifficulty = new BeatmapDifficulty BaseDifficulty = new BeatmapDifficulty
{ {
CircleSize = 4, CircleSize = 1,
DrainRate = 6.5f, DrainRate = 2.3f,
OverallDifficulty = 6.5f, OverallDifficulty = 4.5f,
ApproachRate = 5, ApproachRate = 6,
}, },
OnlineInfo = new BeatmapOnlineInfo OnlineInfo = new BeatmapOnlineInfo
{ {
Length = 115000, Length = 456000,
CircleCount = 265, CircleCount = 111,
SliderCount = 71, SliderCount = 12,
PlayCount = 47906, PlayCount = 222,
PassCount = 19899, PassCount = 21,
},
Metrics = new BeatmapMetrics
{
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6).ToArray(),
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
},
},
new BeatmapInfo
{
StarDifficulty = 2.22,
Version = @"NOVICE",
Ruleset = maniaRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 4,
DrainRate = 7,
OverallDifficulty = 7,
ApproachRate = 5,
},
OnlineInfo = new BeatmapOnlineInfo
{
Length = 118000,
CircleCount = 592,
SliderCount = 62,
PlayCount = 162021,
PassCount = 72116,
},
Metrics = new BeatmapMetrics
{
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6).ToArray(),
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
},
},
new BeatmapInfo
{
StarDifficulty = 3.49,
Version = @"ADVANCED",
Ruleset = maniaRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 4,
DrainRate = 7.5f,
OverallDifficulty = 7.5f,
ApproachRate = 5,
},
OnlineInfo = new BeatmapOnlineInfo
{
Length = 118000,
CircleCount = 1042,
SliderCount = 79,
PlayCount = 225178,
PassCount = 73001,
},
Metrics = new BeatmapMetrics
{
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6).ToArray(),
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
},
},
new BeatmapInfo
{
StarDifficulty = 4.24,
Version = @"EXHAUST",
Ruleset = maniaRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 4,
DrainRate = 8,
OverallDifficulty = 8,
ApproachRate = 5,
},
OnlineInfo = new BeatmapOnlineInfo
{
Length = 118000,
CircleCount = 1352,
SliderCount = 69,
PlayCount = 131545,
PassCount = 42703,
},
Metrics = new BeatmapMetrics
{
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6).ToArray(),
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
},
},
new BeatmapInfo
{
StarDifficulty = 5.26,
Version = @"GRAVITY",
Ruleset = maniaRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 4,
DrainRate = 8.5f,
OverallDifficulty = 8.5f,
ApproachRate = 5,
},
OnlineInfo = new BeatmapOnlineInfo
{
Length = 118000,
CircleCount = 1730,
SliderCount = 115,
PlayCount = 117673,
PassCount = 24241,
}, },
Metrics = new BeatmapMetrics Metrics = new BeatmapMetrics
{ {
@ -245,7 +138,7 @@ namespace osu.Game.Tests.Visual.Online
} }
[Test] [Test]
public void TestUnavailable() public void TestAvailability()
{ {
AddStep(@"show undownloadable", () => AddStep(@"show undownloadable", () =>
{ {
@ -254,13 +147,14 @@ namespace osu.Game.Tests.Visual.Online
OnlineBeatmapSetID = 1234, OnlineBeatmapSetID = 1234,
Metadata = new BeatmapMetadata Metadata = new BeatmapMetadata
{ {
Title = @"Soumatou Labyrinth", Title = @"undownloadable beatmap",
Artist = @"Yunomi with Momobako&miko", Artist = @"no one",
Tags = @"mmbk.com yuzu__rinrin charlotte", Source = @"some source",
Tags = @"another test tag tag more test tags",
Author = new User Author = new User
{ {
Username = @"komasy", Username = @"BanchoBot",
Id = 1980256, Id = 3,
}, },
}, },
OnlineInfo = new BeatmapSetOnlineInfo OnlineInfo = new BeatmapSetOnlineInfo
@ -270,145 +164,38 @@ namespace osu.Game.Tests.Visual.Online
DownloadDisabled = true, DownloadDisabled = true,
ExternalLink = "https://osu.ppy.sh", ExternalLink = "https://osu.ppy.sh",
}, },
Preview = @"https://b.ppy.sh/preview/625493.mp3", Preview = @"https://b.ppy.sh/preview/1234.mp3",
PlayCount = 22996, PlayCount = 123,
FavouriteCount = 58, FavouriteCount = 456,
Submitted = new DateTime(2016, 6, 11), Submitted = DateTime.Now,
Ranked = new DateTime(2016, 7, 12), Ranked = DateTime.Now,
Status = BeatmapSetOnlineStatus.Pending, BPM = 111,
BPM = 160, HasVideo = true,
HasVideo = false, HasStoryboard = true,
Covers = new BeatmapSetOnlineCovers Covers = new BeatmapSetOnlineCovers(),
{
Cover = @"https://assets.ppy.sh/beatmaps/625493/covers/cover.jpg?1499167472",
},
}, },
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() }, Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() },
Beatmaps = new List<BeatmapInfo> Beatmaps = new List<BeatmapInfo>
{ {
new BeatmapInfo new BeatmapInfo
{ {
StarDifficulty = 1.40, StarDifficulty = 5.67,
Version = @"yzrin's Kantan", Version = @"ANOTHER TEST",
Ruleset = taikoRuleset, Ruleset = taikoRuleset,
BaseDifficulty = new BeatmapDifficulty BaseDifficulty = new BeatmapDifficulty
{ {
CircleSize = 2, CircleSize = 9,
DrainRate = 7, DrainRate = 8,
OverallDifficulty = 3, OverallDifficulty = 7,
ApproachRate = 10, ApproachRate = 6,
}, },
OnlineInfo = new BeatmapOnlineInfo OnlineInfo = new BeatmapOnlineInfo
{ {
Length = 193000, Length = 123000,
CircleCount = 262, CircleCount = 123,
SliderCount = 0, SliderCount = 45,
PlayCount = 3952, PlayCount = 567,
PassCount = 1373, PassCount = 89,
},
Metrics = new BeatmapMetrics
{
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6).ToArray(),
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
},
},
new BeatmapInfo
{
StarDifficulty = 2.23,
Version = @"Futsuu",
Ruleset = taikoRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 2,
DrainRate = 6,
OverallDifficulty = 4,
ApproachRate = 10,
},
OnlineInfo = new BeatmapOnlineInfo
{
Length = 193000,
CircleCount = 464,
SliderCount = 0,
PlayCount = 4833,
PassCount = 920,
},
Metrics = new BeatmapMetrics
{
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6).ToArray(),
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
},
},
new BeatmapInfo
{
StarDifficulty = 3.19,
Version = @"Muzukashii",
Ruleset = taikoRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 2,
DrainRate = 6,
OverallDifficulty = 5,
ApproachRate = 10,
},
OnlineInfo = new BeatmapOnlineInfo
{
Length = 193000,
CircleCount = 712,
SliderCount = 0,
PlayCount = 4405,
PassCount = 854,
},
Metrics = new BeatmapMetrics
{
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6).ToArray(),
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
},
},
new BeatmapInfo
{
StarDifficulty = 3.97,
Version = @"Charlotte's Oni",
Ruleset = taikoRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 5,
DrainRate = 6,
OverallDifficulty = 5.5f,
ApproachRate = 10,
},
OnlineInfo = new BeatmapOnlineInfo
{
Length = 193000,
CircleCount = 943,
SliderCount = 0,
PlayCount = 3950,
PassCount = 693,
},
Metrics = new BeatmapMetrics
{
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6).ToArray(),
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
},
},
new BeatmapInfo
{
StarDifficulty = 5.08,
Version = @"Labyrinth Oni",
Ruleset = taikoRuleset,
BaseDifficulty = new BeatmapDifficulty
{
CircleSize = 5,
DrainRate = 5,
OverallDifficulty = 6,
ApproachRate = 10,
},
OnlineInfo = new BeatmapOnlineInfo
{
Length = 193000,
CircleCount = 1068,
SliderCount = 0,
PlayCount = 5856,
PassCount = 1207,
}, },
Metrics = new BeatmapMetrics Metrics = new BeatmapMetrics
{ {

View File

@ -10,6 +10,7 @@ using osu.Game.Beatmaps;
using osu.Game.Overlays.Direct; using osu.Game.Overlays.Direct;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Users;
using osuTK; using osuTK;
namespace osu.Game.Tests.Visual.Online namespace osu.Game.Tests.Visual.Online
@ -23,24 +24,44 @@ namespace osu.Game.Tests.Visual.Online
typeof(IconPill) typeof(IconPill)
}; };
private BeatmapSetInfo getUndownloadableBeatmapSet(RulesetInfo ruleset) private BeatmapSetInfo getUndownloadableBeatmapSet(RulesetInfo ruleset) => new BeatmapSetInfo
{ {
var beatmap = CreateWorkingBeatmap(ruleset).BeatmapSetInfo; OnlineBeatmapSetID = 123,
beatmap.Metadata.Artist = "test"; Metadata = new BeatmapMetadata
beatmap.Metadata.Title = "undownloadable"; {
beatmap.Metadata.AuthorString = "test"; Title = "undownloadable beatmap",
Artist = "test",
beatmap.OnlineInfo.HasVideo = true; Source = "more tests",
beatmap.OnlineInfo.HasStoryboard = true; Author = new User
{
beatmap.OnlineInfo.Availability = new BeatmapSetOnlineAvailability Username = "BanchoBot",
Id = 3,
},
},
OnlineInfo = new BeatmapSetOnlineInfo
{
Availability = new BeatmapSetOnlineAvailability
{ {
DownloadDisabled = true, DownloadDisabled = true,
ExternalLink = "http://osu.ppy.sh", },
}; Preview = @"https://b.ppy.sh/preview/12345.mp3",
PlayCount = 123,
return beatmap; FavouriteCount = 456,
BPM = 111,
HasVideo = true,
HasStoryboard = true,
Covers = new BeatmapSetOnlineCovers(),
},
Beatmaps = new List<BeatmapInfo>
{
new BeatmapInfo
{
Ruleset = ruleset,
Version = "Test",
StarDifficulty = 6.42,
} }
}
};
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()