示例#1
0
        public void TestTeams()
        {
            var jsonResponse = GetEmbeddedResource("UnitTests.ExampleResponses.teams.json");
            var converter = new TeamsConverter();
            var teamsResponse = converter.Convert(jsonResponse);

            // The raw response should be exactly the same as the input
            Assert.AreEqual(jsonResponse, teamsResponse.RawResponse);

            // Expecting 15 teams
            Assert.AreEqual(15, teamsResponse.Result.List.Count);
        }
示例#2
0
        /// <summary>
        /// Returns all teams for the current club (the club is determined by the service using the service code)
        /// </summary>
        /// <returns></returns>
        public ResponseResult<Teams> GetTeams()
        {
            var queryString = HttpUtility.ParseQueryString(String.Empty);
            queryString["t"] = "teams";
            queryString["t_id"] = "";
            queryString["p"] = "0";
            queryString["full"] = "0";

            var response = Execute(queryString);
            var converter = new TeamsConverter();
            var teams = converter.Convert(response);
            return teams;
        }