예제 #1
0
        public void TestResults()
        {
            var jsonResponse = GetEmbeddedResource("UnitTests.ExampleResponses.results.json");
            var converter = new ResultsConverter();
            var resultsResponse = converter.Convert(jsonResponse);

            // Expecting 16 match result
            Assert.AreEqual(16, resultsResponse.Result.Matches.Count);
        }
예제 #2
0
        /// <summary>
        /// Returns paged poule results for the given teams
        /// </summary>
        /// <param name="teamIds"></param>
        /// <param name="paging"></param>
        /// <param name="allResults"></param>
        /// <returns></returns>
        public ResponseResult<Results> GetResults(int[] teamIds, int paging, bool allResults = false)
        {
            var queryString = HttpUtility.ParseQueryString(String.Empty);
            queryString["t"] = "result";
            queryString["t_id"] = (teamIds != null) ? String.Join(",", teamIds) : String.Empty;
            queryString["p"] = paging.ToString(CultureInfo.InvariantCulture);
            queryString["full"] = (allResults) ? "1" : "0";

            var response = Execute(queryString);
            var converter = new ResultsConverter();
            var results = converter.Convert(response);
            return results;
        }