public void TestGetLeagues() { FootWebClient client = new FootWebClient(); League[] leagues = client.GetLeagues(); Assert.AreEqual(17, leagues.Length); Assert.AreEqual("Campeonato Brasileiro da Série A", leagues[0].Caption); Assert.AreEqual("Premier League 2017/18", leagues[1].Caption); }
public FoothubModule() { Get["/leagues"] = _ => { League[] leagues = client.GetLeagues(); FootHubViewModel model = new FootHubViewModel( "Football Leagues", LeaguesToHtml(leagues)); return(View["ViewTable", model]); }; Get["/leagues/{leagueId}"] = args => { Standing[] standings = client.GetLeagueTable(args.leagueId); FootHubViewModel model = new FootHubViewModel( "League Table", StandingsToHtml(standings)); return(View["ViewTable", model]); }; Get["/teams/{teamId}"] = args => { // TO DO !!!!! FootHubViewModel model = new FootHubViewModel( "Team Details", ""); return(View["ViewDetails", model]); }; }