1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 04:59:52 +08:00

Merge pull request #2730 from ekrctb/fix-ImportBeatmapTest

Fix ImportBeatmapTest not working on .net core
This commit is contained in:
Dean Herbert
2018-06-06 19:08:45 +09:00
committed by GitHub
Unverified
@@ -264,7 +264,8 @@ namespace osu.Game.Tests.Beatmaps.IO
private string createTemporaryBeatmap()
{
var temp = new FileInfo(osz_path).CopyTo(Path.GetTempFileName(), true).FullName;
var temp = Path.GetTempFileName() + ".osz";
File.Copy(osz_path, temp, true);
Assert.IsTrue(File.Exists(temp));
return temp;
}
@@ -344,12 +345,12 @@ namespace osu.Game.Tests.Beatmaps.IO
private void waitForOrAssert(Func<bool> result, string failureMessage, int timeout = 60000)
{
Action waitAction = () =>
Task task = Task.Run(() =>
{
while (!result()) Thread.Sleep(200);
};
});
Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(timeout), failureMessage);
Assert.IsTrue(task.Wait(timeout), failureMessage);
}
}
}