1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:22:55 +08:00

Avoid embedding NUnit Assert inside test steps if possible

This commit is contained in:
Salman Ahmed 2020-09-19 05:56:35 +03:00
parent 1e1422c16a
commit 522e2cdbcd

View File

@ -125,11 +125,11 @@ namespace osu.Game.Tests.Visual.Gameplay
AddStep("trigger skin change", () => skinSource.TriggerSourceChanged());
AddStep("retrieve new sample", () =>
AddAssert("retrieve and ensure current sample is different", () =>
{
DrawableSample newSample = skinnableSound.ChildrenOfType<DrawableSample>().Single();
Assert.IsTrue(newSample != sample, "Sample still hasn't been updated after a skin change event");
sample = newSample;
DrawableSample oldSample = sample;
sample = skinnableSound.ChildrenOfType<DrawableSample>().Single();
return sample != oldSample;
});
AddAssert("new sample stopped", () => !sample.Playing);