1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 14:12:56 +08:00

TestCase improvement

This commit is contained in:
Andrei Zavatski 2019-08-04 15:00:02 +03:00
parent 3ae5428dad
commit cd7b6d2d27

View File

@ -10,6 +10,7 @@ using osu.Game.Rulesets.Mania;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Taiko; using osu.Game.Rulesets.Taiko;
using osu.Game.Users; using osu.Game.Users;
using osu.Framework.Bindables;
namespace osu.Game.Tests.Visual.Online namespace osu.Game.Tests.Visual.Online
{ {
@ -24,11 +25,13 @@ namespace osu.Game.Tests.Visual.Online
public TestSceneProfileRulesetSelector() public TestSceneProfileRulesetSelector()
{ {
ProfileRulesetSelector selector; ProfileRulesetSelector selector;
Bindable<User> user = new Bindable<User>();
Child = selector = new ProfileRulesetSelector Child = selector = new ProfileRulesetSelector
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
User = { BindTarget = user }
}; };
AddStep("set osu! as default", () => selector.SetDefaultRuleset(new OsuRuleset().RulesetInfo)); AddStep("set osu! as default", () => selector.SetDefaultRuleset(new OsuRuleset().RulesetInfo));
@ -36,11 +39,11 @@ namespace osu.Game.Tests.Visual.Online
AddStep("set taiko as default", () => selector.SetDefaultRuleset(new TaikoRuleset().RulesetInfo)); AddStep("set taiko as default", () => selector.SetDefaultRuleset(new TaikoRuleset().RulesetInfo));
AddStep("set catch as default", () => selector.SetDefaultRuleset(new CatchRuleset().RulesetInfo)); AddStep("set catch as default", () => selector.SetDefaultRuleset(new CatchRuleset().RulesetInfo));
AddStep("User with osu as default", () => selector.User.Value = new User { PlayMode = "osu" }); AddStep("User with osu as default", () => user.Value = new User { PlayMode = "osu" });
AddStep("User with mania as default", () => selector.User.Value = new User { PlayMode = "mania" }); AddStep("User with mania as default", () => user.Value = new User { PlayMode = "mania" });
AddStep("User with taiko as default", () => selector.User.Value = new User { PlayMode = "taiko" }); AddStep("User with taiko as default", () => user.Value = new User { PlayMode = "taiko" });
AddStep("User with catch as default", () => selector.User.Value = new User { PlayMode = "fruits" }); AddStep("User with catch as default", () => user.Value = new User { PlayMode = "fruits" });
AddStep("null user", () => selector.User.Value = null); AddStep("null user", () => user.Value = null);
} }
} }
} }