1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 02:02:53 +08:00

Add asserts to the test scene

This commit is contained in:
Andrei Zavatski 2019-09-19 16:45:38 +03:00
parent 708dfa2bdc
commit 41be9b3f8f

View File

@ -36,15 +36,18 @@ namespace osu.Game.Tests.Visual.UserInterface
setMaxPages(200);
setCurrentPage(201);
});
AddAssert("Current equals max", () => pageSelector.CurrentPage.Value == pageSelector.MaxPages.Value);
AddStep("200 max pages, current -10", () =>
{
setMaxPages(200);
setCurrentPage(-10);
});
AddAssert("Current is 1", () => pageSelector.CurrentPage.Value == 1);
AddStep("-10 max pages", () =>
{
setMaxPages(-10);
});
AddAssert("Current is 1, max is 1", () => pageSelector.CurrentPage.Value == 1 && pageSelector.MaxPages.Value == 1);
}
private void setMaxPages(int maxPages) => pageSelector.MaxPages.Value = maxPages;