1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 15:33:21 +08:00

Add more assertions

This commit is contained in:
smoogipoo 2020-01-10 12:39:45 +09:00
parent 5f5878e37e
commit 524ff41931

View File

@ -616,8 +616,15 @@ namespace osu.Game.Tests.Beatmaps.IO
manager.UpdateFile(setToUpdate, fileToUpdate, stream);
}
Beatmap updatedBeatmap = (Beatmap)manager.GetWorkingBeatmap(manager.QueryBeatmap(b => b.ID == beatmapToUpdate.BeatmapInfo.ID)).Beatmap;
// Check that the old file has been dereferenced
Assert.That(manager.Files.QueryFiles(f => f.ID == fileToUpdate.FileInfoID).SingleOrDefault(), Is.Null);
// Ensure that the old file is deleted upon a cleanup
manager.Files.Cleanup();
Assert.That(new System.IO.FileInfo(manager.Files.Storage.GetFullPath(fileToUpdate.FileInfo.StoragePath)), Does.Not.Exist);
// Check that the new file is referenced correctly by attempting a retrieval
Beatmap updatedBeatmap = (Beatmap)manager.GetWorkingBeatmap(manager.QueryBeatmap(b => b.ID == beatmapToUpdate.BeatmapInfo.ID)).Beatmap;
Assert.That(updatedBeatmap.HitObjects.Count, Is.EqualTo(1));
Assert.That(updatedBeatmap.HitObjects[0].StartTime, Is.EqualTo(5000));
}