public void TestPlaylistItemSelectedOnCreate()
        {
            AddStep("set room properties", () =>
            {
                Room.Name.Value = "my awesome room";
                Room.Host.Value = new User {
                    Id = 2, Username = "******"
                };
                Room.Playlist.Add(new PlaylistItem
                {
                    Beatmap = { Value = new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo },
                    Ruleset = { Value = new OsuRuleset().RulesetInfo }
                });
            });

            AddStep("move mouse to create button", () =>
            {
                var footer = match.ChildrenOfType <Footer>().Single();
                InputManager.MoveMouseTo(footer.ChildrenOfType <OsuButton>().Single());
            });

            AddStep("click", () => InputManager.Click(MouseButton.Left));

            AddAssert("first playlist item selected", () => match.SelectedItem.Value == Room.Playlist[0]);
        }
        public void TestLoadSimpleMatch()
        {
            AddStep("set room properties", () =>
            {
                Room.RoomID.Value = 1;
                Room.Name.Value   = "my awesome room";
                Room.Host.Value   = new User {
                    Id = 2, Username = "******"
                };
                Room.RecentParticipants.Add(Room.Host.Value);
                Room.EndDate.Value = DateTimeOffset.Now.AddMinutes(5);
                Room.Playlist.Add(new PlaylistItem
                {
                    Beatmap = { Value = new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo },
                    Ruleset = { Value = new OsuRuleset().RulesetInfo }
                });
            });

            AddStep("start match", () => match.ChildrenOfType <PlaylistsReadyButton>().First().Click());
            AddUntilStep("player loader loaded", () => Stack.CurrentScreen is PlayerLoader);
        }
        public void TestBeatmapUpdatedOnReImport()
        {
            BeatmapSetInfo importedSet = null;

            AddStep("import altered beatmap", () =>
            {
                var beatmap = new TestBeatmap(new OsuRuleset().RulesetInfo);
                beatmap.BeatmapInfo.BaseDifficulty.CircleSize = 1;

                importedSet = manager.Import(beatmap.BeatmapInfo.BeatmapSet).Result;
            });

            AddStep("load room", () =>
            {
                Room.Name.Value = "my awesome room";
                Room.Host.Value = new User {
                    Id = 2, Username = "******"
                };
                Room.Playlist.Add(new PlaylistItem
                {
                    Beatmap = { Value = importedSet.Beatmaps[0] },
                    Ruleset = { Value = new OsuRuleset().RulesetInfo }
                });
            });

            AddStep("create room", () =>
            {
                InputManager.MoveMouseTo(match.ChildrenOfType <PlaylistsMatchSettingsOverlay.CreateRoomButton>().Single());
                InputManager.Click(MouseButton.Left);
            });

            AddAssert("match has altered beatmap", () => match.Beatmap.Value.Beatmap.BeatmapInfo.BaseDifficulty.CircleSize == 1);

            AddStep("re-import original beatmap", () => manager.Import(new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo.BeatmapSet).Wait());

            AddAssert("match has original beatmap", () => match.Beatmap.Value.Beatmap.BeatmapInfo.BaseDifficulty.CircleSize != 1);
        }