1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-17 16:42:53 +08:00
osu-lazer/osu.Game.Tests/Visual/Multiplayer/TestSceneMatchInfo.cs

79 lines
2.8 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-05-29 14:24:38 +08:00
2018-12-14 13:20:03 +08:00
using System;
using System.Collections.Generic;
2018-05-29 14:24:38 +08:00
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Game.Beatmaps;
using osu.Game.Online.Multiplayer;
2018-12-27 12:30:36 +08:00
using osu.Game.Online.Multiplayer.RoomStatuses;
2018-05-29 14:24:38 +08:00
using osu.Game.Rulesets;
2018-12-10 18:20:41 +08:00
using osu.Game.Screens.Multi.Match.Components;
2018-05-29 14:24:38 +08:00
2019-03-25 00:02:36 +08:00
namespace osu.Game.Tests.Visual.Multiplayer
2018-05-29 14:24:38 +08:00
{
[TestFixture]
public class TestSceneMatchInfo : MultiplayerTestScene
2018-05-29 14:24:38 +08:00
{
2018-12-14 13:20:03 +08:00
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(Info),
typeof(HeaderButton),
typeof(ReadyButton),
typeof(ViewBeatmapButton)
};
2018-05-29 14:24:38 +08:00
[BackgroundDependencyLoader]
private void load(RulesetStore rulesets)
{
2019-02-05 18:00:01 +08:00
Add(new Info());
2018-12-22 13:01:06 +08:00
2019-02-05 18:00:01 +08:00
AddStep(@"set name", () => Room.Name.Value = @"Room Name?");
AddStep(@"set availability", () => Room.Availability.Value = RoomAvailability.FriendsOnly);
AddStep(@"set status", () => Room.Status.Value = new RoomStatusPlaying());
2018-12-22 13:01:06 +08:00
AddStep(@"set beatmap", () =>
2018-05-29 14:24:38 +08:00
{
2019-02-05 18:00:01 +08:00
Room.Playlist.Clear();
Room.Playlist.Add(new PlaylistItem
2018-05-29 14:24:38 +08:00
{
2018-12-22 13:01:06 +08:00
Beatmap = new BeatmapInfo
{
StarDifficulty = 2.4,
Ruleset = rulesets.GetRuleset(0),
Metadata = new BeatmapMetadata
{
Title = @"My Song",
Artist = @"VisualTests",
AuthorString = @"osu!lazer",
},
}
});
2018-05-29 14:24:38 +08:00
});
2019-02-05 18:00:01 +08:00
AddStep(@"change name", () => Room.Name.Value = @"Room Name!");
AddStep(@"change availability", () => Room.Availability.Value = RoomAvailability.InviteOnly);
AddStep(@"change status", () => Room.Status.Value = new RoomStatusOpen());
AddStep(@"null beatmap", () => Room.Playlist.Clear());
2018-12-22 13:01:06 +08:00
AddStep(@"change beatmap", () =>
2018-05-29 14:24:38 +08:00
{
2019-02-05 18:00:01 +08:00
Room.Playlist.Clear();
Room.Playlist.Add(new PlaylistItem
2018-05-29 14:24:38 +08:00
{
2018-12-22 13:01:06 +08:00
Beatmap = new BeatmapInfo
{
StarDifficulty = 4.2,
Ruleset = rulesets.GetRuleset(3),
Metadata = new BeatmapMetadata
{
Title = @"Your Song",
Artist = @"Tester",
AuthorString = @"Someone",
},
}
});
2018-05-29 14:24:38 +08:00
});
}
}
}