1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:02:55 +08:00

Fix usage of _ in Moq lambdas

This commit is contained in:
Naxess 2021-04-20 13:29:14 +02:00
parent 6a1e4ff99f
commit c0318a4d3e
2 changed files with 8 additions and 8 deletions

View File

@ -37,8 +37,8 @@ namespace osu.Game.Tests.Editing.Checks
beatmap.Metadata.AudioFile = null;
var mock = new Mock<IWorkingBeatmap>();
mock.SetupGet(_ => _.Beatmap).Returns(beatmap);
mock.SetupGet(_ => _.Track).Returns((Track)null);
mock.SetupGet(w => w.Beatmap).Returns(beatmap);
mock.SetupGet(w => w.Track).Returns((Track)null);
Assert.That(check.Run(beatmap, mock.Object), Is.Empty);
}
@ -102,11 +102,11 @@ namespace osu.Game.Tests.Editing.Checks
private Mock<IWorkingBeatmap> getMockWorkingBeatmap(int? audioBitrate)
{
var mockTrack = new Mock<Track>();
mockTrack.SetupGet(_ => _.Bitrate).Returns(audioBitrate);
mockTrack.SetupGet(t => t.Bitrate).Returns(audioBitrate);
var mockWorkingBeatmap = new Mock<IWorkingBeatmap>();
mockWorkingBeatmap.SetupGet(_ => _.Beatmap).Returns(beatmap);
mockWorkingBeatmap.SetupGet(_ => _.Track).Returns(mockTrack.Object);
mockWorkingBeatmap.SetupGet(w => w.Beatmap).Returns(beatmap);
mockWorkingBeatmap.SetupGet(w => w.Track).Returns(mockTrack.Object);
return mockWorkingBeatmap;
}

View File

@ -120,9 +120,9 @@ namespace osu.Game.Tests.Editing.Checks
var stream = new MemoryStream(fileBytes ?? new byte[1024 * 1024]);
var mock = new Mock<IWorkingBeatmap>();
mock.SetupGet(_ => _.Beatmap).Returns(beatmap);
mock.SetupGet(_ => _.Background).Returns(background);
mock.Setup(_ => _.GetStream(It.IsAny<string>())).Returns(stream);
mock.SetupGet(w => w.Beatmap).Returns(beatmap);
mock.SetupGet(w => w.Background).Returns(background);
mock.Setup(w => w.GetStream(It.IsAny<string>())).Returns(stream);
return mock;
}