1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:07:25 +08:00

Split tests

This commit is contained in:
Andrei Zavatski 2019-11-06 12:54:04 +03:00
parent b35b3484ca
commit 5589329e16

View File

@ -29,16 +29,9 @@ namespace osu.Game.Tests.Visual.Online
private VotePill votePill; private VotePill votePill;
[BackgroundDependencyLoader] [Test]
private void load() public void TestUserCommentPill()
{ {
var randomComment = new Comment
{
IsVoted = false,
UserId = 4444,
VotesCount = 2,
};
AddStep("Log in", () => api.LocalUser.Value = new User AddStep("Log in", () => api.LocalUser.Value = new User
{ {
Id = RNG.Next(2, 100000) Id = RNG.Next(2, 100000)
@ -46,13 +39,25 @@ namespace osu.Game.Tests.Visual.Online
AddStep("User comment", () => addVotePill(getUserComment())); AddStep("User comment", () => addVotePill(getUserComment()));
AddStep("Click", () => votePill.Click()); AddStep("Click", () => votePill.Click());
AddAssert("Not loading", () => !votePill.IsLoading); AddAssert("Not loading", () => !votePill.IsLoading);
}
AddStep("Random comment", () => addVotePill(randomComment)); [Test]
public void TestRandomCommentPill()
{
AddStep("Log in", () => api.LocalUser.Value = new User
{
Id = RNG.Next(2, 100000)
});
AddStep("Random comment", () => addVotePill(getRandomComment()));
AddStep("Click", () => votePill.Click()); AddStep("Click", () => votePill.Click());
AddAssert("Loading", () => votePill.IsLoading); AddAssert("Loading", () => votePill.IsLoading);
}
[Test]
public void TestOfflineRandomCommentPill()
{
AddStep("Log out", api.Logout); AddStep("Log out", api.Logout);
AddStep("Random comment", () => addVotePill(randomComment)); AddStep("Random comment", () => addVotePill(getRandomComment()));
AddStep("Click", () => votePill.Click()); AddStep("Click", () => votePill.Click());
AddAssert("Not loading", () => !votePill.IsLoading); AddAssert("Not loading", () => !votePill.IsLoading);
} }
@ -64,6 +69,13 @@ namespace osu.Game.Tests.Visual.Online
VotesCount = 10, VotesCount = 10,
}; };
private Comment getRandomComment() => new Comment
{
IsVoted = false,
UserId = 4444,
VotesCount = 2,
};
private void addVotePill(Comment comment) private void addVotePill(Comment comment)
{ {
Clear(); Clear();