Ejemplo n.º 1
0
        public void ReturnNullWhenProfileDataIsNull()
        {
            var lobbyManager = new LobbyManagerStub();
            var lobbyUrl     = GameWorker.GetProLobbyUrl(lobbyManager, "123456");

            Assert.IsNull(lobbyUrl, "Lobby url must be null when profile data is null.");
        }
Ejemplo n.º 2
0
        public void ReturnNullWhenGameIdIsNull()
        {
            var lobbyManager = new LobbyManagerStub(null, "1234");
            var lobbyUrl     = GameWorker.GetProLobbyUrl(lobbyManager, "123456");

            Assert.IsNull(lobbyUrl, "Lobby url must be null when gameId is null.");
        }
Ejemplo n.º 3
0
        public void ReturnNullWhenLobbySteamIdIsNull()
        {
            var lobbyManager = new LobbyManagerStub("9876", null);
            var lobbyUrl     = GameWorker.GetProLobbyUrl(lobbyManager, "123456");

            Assert.IsNull(lobbyUrl, "Lobby url must be null when lobbySteamId is null.");
        }
Ejemplo n.º 4
0
        public void ReturnCorrectLobbyUrlWhenPlayerHasCorrectProfileData()
        {
            const string gameId       = "9876";
            const string lobbyId      = "1234";
            const string playerId     = "13579";
            var          lobbyManager = new LobbyManagerStub(gameId, lobbyId);
            var          lobbyUrl     = GameWorker.GetProLobbyUrl(lobbyManager, playerId);

            Assert.IsNotNull(lobbyUrl, "LobbyUrl must be not null.");
            StringAssert.IsMatch($"steam://joinlobby/{gameId}/{lobbyId}/{playerId}", lobbyUrl, "Lobby has incorrect format.");
        }
Ejemplo n.º 5
0
        public string ProLobbyUrl(string proId)
        {
            if (string.IsNullOrEmpty(proId))
            {
                return(null);
            }

            var webClient    = new WebClient();
            var lobbyManager = new LobbyManager(webClient);

            var result = GameWorker.GetProLobbyUrl(lobbyManager, proId);

            return(result);
        }