Ejemplo n.º 1
0
        public void TestJoinRoomWithPassword()
        {
            AddStep("create room", () =>
            {
                multiplayerScreen.RoomManager.AddRoom(new Room
                {
                    Name     = { Value = "Test Room" },
                    Password = { Value = "password" },
                    Playlist =
                    {
                        new PlaylistItem
                        {
                            Beatmap ={ Value               = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.RulesetID == 0)).BeatmapInfo },
                            Ruleset ={ Value               = new OsuRuleset().RulesetInfo                                                              },
                        }
                    }
                });
            });

            AddStep("refresh rooms", () => multiplayerScreen.RoomManager.Filter.Value = new FilterCriteria());
            AddStep("select room", () => InputManager.Key(Key.Down));
            AddStep("join room", () => InputManager.Key(Key.Enter));

            DrawableRoom.PasswordEntryPopover passwordEntryPopover = null;
            AddUntilStep("password prompt appeared", () => (passwordEntryPopover = InputManager.ChildrenOfType <DrawableRoom.PasswordEntryPopover>().FirstOrDefault()) != null);
            AddStep("enter password in text box", () => passwordEntryPopover.ChildrenOfType <TextBox>().First().Text = "password");
            AddStep("press join room button", () => passwordEntryPopover.ChildrenOfType <OsuButton>().First().TriggerClick());

            AddUntilStep("wait for room open", () => this.ChildrenOfType <MultiplayerMatchSubScreen>().FirstOrDefault()?.IsLoaded == true);
            AddUntilStep("wait for join", () => client.Room != null);
        }
Ejemplo n.º 2
0
        public void TestJoinRoomWithPassword()
        {
            DrawableRoom.PasswordEntryPopover passwordEntryPopover = null;

            AddStep("add room", () => RoomManager.AddRooms(1, withPassword: true));
            AddStep("select room", () => InputManager.Key(Key.Down));
            AddStep("attempt join room", () => InputManager.Key(Key.Enter));
            AddUntilStep("password prompt appeared", () => (passwordEntryPopover = InputManager.ChildrenOfType <DrawableRoom.PasswordEntryPopover>().FirstOrDefault()) != null);
            AddStep("enter password in text box", () => passwordEntryPopover.ChildrenOfType <TextBox>().First().Text = "password");
            AddStep("press join room button", () => passwordEntryPopover.ChildrenOfType <OsuButton>().First().Click());

            AddAssert("room join requested", () => lastJoinedRoom == RoomManager.Rooms.First());
            AddAssert("room join password correct", () => lastJoinedPassword == "password");
        }