mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 16:52:54 +08:00
Remove no longer applicable test
After dd06dd0e699311494412e36bc3f37bb055a01477 the behaviour set up on the mock in the test in question is no longer realistic. Online metadata lookups will no longer fall back to online ID or filename.
This commit is contained in:
parent
776fabd77c
commit
2c2f307a63
@ -383,58 +383,5 @@ namespace osu.Game.Tests.Beatmaps
|
||||
|
||||
Assert.That(beatmapSet.Status, Is.EqualTo(BeatmapOnlineStatus.None));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestPartiallyMaliciousSet([Values] bool preferOnlineFetch)
|
||||
{
|
||||
var firstResult = new OnlineBeatmapMetadata
|
||||
{
|
||||
BeatmapID = 654321,
|
||||
BeatmapStatus = BeatmapOnlineStatus.Ranked,
|
||||
BeatmapSetStatus = BeatmapOnlineStatus.Ranked,
|
||||
MD5Hash = @"cafebabe"
|
||||
};
|
||||
var secondResult = new OnlineBeatmapMetadata
|
||||
{
|
||||
BeatmapStatus = BeatmapOnlineStatus.Ranked,
|
||||
BeatmapSetStatus = BeatmapOnlineStatus.Ranked,
|
||||
MD5Hash = @"dededede"
|
||||
};
|
||||
|
||||
var targetMock = preferOnlineFetch ? apiMetadataSourceMock : localCachedMetadataSourceMock;
|
||||
targetMock.Setup(src => src.Available).Returns(true);
|
||||
targetMock.Setup(src => src.TryLookup(It.Is<BeatmapInfo>(bi => bi.OnlineID == 654321), out firstResult))
|
||||
.Returns(true);
|
||||
targetMock.Setup(src => src.TryLookup(It.Is<BeatmapInfo>(bi => bi.OnlineID == 666666), out secondResult))
|
||||
.Returns(true);
|
||||
|
||||
var firstBeatmap = new BeatmapInfo
|
||||
{
|
||||
OnlineID = 654321,
|
||||
MD5Hash = @"cafebabe",
|
||||
};
|
||||
var secondBeatmap = new BeatmapInfo
|
||||
{
|
||||
OnlineID = 666666,
|
||||
MD5Hash = @"deadbeef"
|
||||
};
|
||||
var beatmapSet = new BeatmapSetInfo(new[]
|
||||
{
|
||||
firstBeatmap,
|
||||
secondBeatmap
|
||||
});
|
||||
firstBeatmap.BeatmapSet = beatmapSet;
|
||||
secondBeatmap.BeatmapSet = beatmapSet;
|
||||
|
||||
metadataLookup.Update(beatmapSet, preferOnlineFetch);
|
||||
|
||||
Assert.That(firstBeatmap.Status, Is.EqualTo(BeatmapOnlineStatus.Ranked));
|
||||
Assert.That(firstBeatmap.OnlineID, Is.EqualTo(654321));
|
||||
|
||||
Assert.That(secondBeatmap.Status, Is.EqualTo(BeatmapOnlineStatus.None));
|
||||
Assert.That(secondBeatmap.OnlineID, Is.EqualTo(-1));
|
||||
|
||||
Assert.That(beatmapSet.Status, Is.EqualTo(BeatmapOnlineStatus.None));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user