Exemple #1
0
        public void TestProgram()
        {
            var jsonResponse = GetEmbeddedResource("UnitTests.ExampleResponses.program.json");
            var converter = new ProgramConverter();
            var programResponse = converter.Convert(jsonResponse);

            // Expecting 15 matches
            Assert.AreEqual(15, programResponse.Result.Matches.Count);

            // Expecting a program for 1 week
            Assert.AreEqual(1, programResponse.Result.Weeks.Count);
        }
Exemple #2
0
        /// <summary>
        /// Returns the poule program for the given teams
        /// </summary>
        /// <param name="teamIds">Select teams to request the program</param>
        /// <param name="fullProgram">Indication for returning the full program or only for the current week.</param>
        /// <returns></returns>
        public ResponseResult<Program> GetProgram(int[] teamIds, bool fullProgram)
        {
            var queryString = HttpUtility.ParseQueryString(String.Empty);
            queryString["t"] = "program";
            queryString["t_id"] = (teamIds != null) ? String.Join(",", teamIds) : String.Empty;
            queryString["p"] = "0";
            queryString["full"] = (fullProgram) ? "1" : "0";

            var response = Execute(queryString);
            var converter = new ProgramConverter();
            var program = converter.Convert(response);
            return program;
        }