mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Expose login errors from IAPIProvider
and show on the login form
This commit is contained in:
@ -6,6 +6,7 @@ using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Overlays.Login;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Menus
|
||||
@ -30,12 +31,25 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestBasicLogin()
|
||||
public void TestLoginSuccess()
|
||||
{
|
||||
AddStep("logout", () => API.Logout());
|
||||
|
||||
AddStep("enter password", () => loginPanel.ChildrenOfType<OsuPasswordTextBox>().First().Text = "password");
|
||||
AddStep("submit", () => loginPanel.ChildrenOfType<OsuButton>().First(b => b.Text.ToString() == "Sign in").TriggerClick());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLoginFailure()
|
||||
{
|
||||
AddStep("logout", () =>
|
||||
{
|
||||
API.Logout();
|
||||
((DummyAPIAccess)API).FailNextLogin();
|
||||
});
|
||||
|
||||
AddStep("enter password", () => loginPanel.ChildrenOfType<OsuPasswordTextBox>().First().Text = "password");
|
||||
AddStep("submit", () => loginPanel.ChildrenOfType<OsuButton>().First(b => b.Text.ToString() == "Sign in").TriggerClick());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user