Fix most warnings.

This commit is contained in:
Dean Herbert
2017-03-07 10:59:19 +09:00
parent 9106c45858
commit 0cad5d7d41
168 changed files with 504 additions and 473 deletions

View File

@ -23,7 +23,7 @@ namespace osu.Game.Tests.Beatmaps.IO
[TestFixture]
public class ImportBeatmapTest
{
const string osz_path = @"../../../osu-resources/osu.Game.Resources/Beatmaps/241526 Soleily - Renatus.osz";
private const string osz_path = @"../../../osu-resources/osu.Game.Resources/Beatmaps/241526 Soleily - Renatus.osz";
[OneTimeSetUp]
public void SetUp()
@ -91,8 +91,7 @@ namespace osu.Game.Tests.Beatmaps.IO
Assert.IsTrue(File.Exists(temp));
using (FileStream stream = File.OpenRead(temp))
osu.Dependencies.Get<BeatmapDatabase>().Import(temp);
osu.Dependencies.Get<BeatmapDatabase>().Import(temp);
ensureLoaded(osu);
@ -107,7 +106,7 @@ namespace osu.Game.Tests.Beatmaps.IO
private string prepareTempCopy(string path)
{
var temp = Path.GetTempFileName();
return new FileInfo(osz_path).CopyTo(temp, true).FullName;
return new FileInfo(path).CopyTo(temp, true).FullName;
}
private OsuGameBase loadOsu(GameHost host)
@ -130,13 +129,13 @@ namespace osu.Game.Tests.Beatmaps.IO
Action waitAction = () =>
{
while ((resultSets = osu.Dependencies.Get<BeatmapDatabase>()
.Query<BeatmapSetInfo>().Where(s => s.OnlineBeatmapSetID == 241526)).Count() == 0)
while (!(resultSets = osu.Dependencies.Get<BeatmapDatabase>()
.Query<BeatmapSetInfo>().Where(s => s.OnlineBeatmapSetID == 241526)).Any())
Thread.Sleep(50);
};
Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(timeout),
$@"BeatmapSet did not import to the database in allocated time.");
@"BeatmapSet did not import to the database in allocated time.");
//ensure we were stored to beatmap database backing...
@ -168,7 +167,7 @@ namespace osu.Game.Tests.Beatmaps.IO
var beatmap = osu.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.Mode == PlayMode.Osu))?.Beatmap;
Assert.IsTrue(beatmap.HitObjects.Count > 0);
Assert.IsTrue(beatmap?.HitObjects.Count > 0);
}
}
}