From fdf5867a1a6beb07bb5446651a01fb73337f9c85 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 25 Feb 2017 11:46:04 +0900 Subject: [PATCH] Add more informative asserts in unit tests. --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index fe0abd6d87..24d2ad9209 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -84,16 +84,16 @@ namespace osu.Game.Tests.Beatmaps.IO Action waitAction = () => { while ((resultSets = osu.Dependencies.Get() - .Query().Where(s => s.OnlineBeatmapSetID == 241526)).Count() != 1) - Thread.Sleep(1); + .Query().Where(s => s.OnlineBeatmapSetID == 241526)).Count() == 0) + Thread.Sleep(50); }; Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(timeout), - @"BeatmapSet did not import to the database"); + $@"BeatmapSet did not import to the database in allocated time."); //ensure we were stored to beatmap database backing... - Assert.IsTrue(resultSets.Count() == 1); + Assert.IsTrue(resultSets.Count() == 1, $@"Incorrect result count found ({resultSets.Count()} but should be 1)."); IEnumerable resultBeatmaps = null;