mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 22:33:05 +08:00
Better describe test steps to discern on failures
This commit is contained in:
parent
2db0da6e94
commit
366f074f86
@ -30,22 +30,22 @@ namespace osu.Game.Tests.NonVisual
|
|||||||
IDisposable secondOperation = null;
|
IDisposable secondOperation = null;
|
||||||
|
|
||||||
AddStep("begin first operation", () => firstOperation = tracker.BeginOperation());
|
AddStep("begin first operation", () => firstOperation = tracker.BeginOperation());
|
||||||
AddAssert("operation in progress", () => operationInProgress.Value);
|
AddAssert("first operation in progress", () => operationInProgress.Value);
|
||||||
|
|
||||||
AddStep("cannot start another operation",
|
AddStep("cannot start another operation",
|
||||||
() => Assert.Throws<InvalidOperationException>(() => tracker.BeginOperation()));
|
() => Assert.Throws<InvalidOperationException>(() => tracker.BeginOperation()));
|
||||||
|
|
||||||
AddStep("end first operation", () => firstOperation.Dispose());
|
AddStep("end first operation", () => firstOperation.Dispose());
|
||||||
AddAssert("operation is ended", () => !operationInProgress.Value);
|
AddAssert("first operation is ended", () => !operationInProgress.Value);
|
||||||
|
|
||||||
AddStep("start second operation", () => secondOperation = tracker.BeginOperation());
|
AddStep("start second operation", () => secondOperation = tracker.BeginOperation());
|
||||||
AddAssert("operation in progress", () => operationInProgress.Value);
|
AddAssert("second operation in progress", () => operationInProgress.Value);
|
||||||
|
|
||||||
AddStep("dispose first operation again", () => firstOperation.Dispose());
|
AddStep("dispose first operation again", () => firstOperation.Dispose());
|
||||||
AddAssert("operation in progress", () => operationInProgress.Value);
|
AddAssert("second operation still in progress", () => operationInProgress.Value);
|
||||||
|
|
||||||
AddStep("dispose second operation", () => secondOperation.Dispose());
|
AddStep("dispose second operation", () => secondOperation.Dispose());
|
||||||
AddAssert("operation is ended", () => !operationInProgress.Value);
|
AddAssert("second operation is ended", () => !operationInProgress.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
Loading…
Reference in New Issue
Block a user