public string GetAllTourneys(UserInfo _data) { TourneyManager tm = new TourneyManager(); TournamentList tl = tm.GetAllTourneys(_data.username); return(JsonConvert.SerializeObject(tl)); }
public string GetTourney(UserInfo _data, TourneyInt _t) { TourneyManager tm = new TourneyManager(); Tournament t = tm.GetTournament(_data.username, _t.tid); return(JsonConvert.SerializeObject(t)); }
public void GetAllTourneysTest() { string username = GetRandomAlphaNumeric(); TourneyManager test = new TourneyManager(); TournamentList tl = test.GetAllTourneys(username); Assert.IsNotNull(tl); }
public void CreateNewTourneyTest() { Tournament t = new Tournament(); t.host.username = "******"; t.host.email = "*****@*****.**"; t.numParticipants = 4; t.tname = GetRandomAlphaNumeric(); t.commaDlParts = "1,2,3,4"; TourneyManager test = new TourneyManager(); Assert.IsTrue(test.CreateNewTourney(t).GetType() == t.GetType()); }
public string NewTourney(UserInfo _data, Tournament _t) { //_t needs the following: //tname, name of tournament //numParticipants, # of participants //host.email, _data.email //commaDlParts, comma delineated string of participant emails (no spaces or other characters) TourneyManager tm = new TourneyManager(); _t.host.email = _data.email; _t.host.username = _data.username; Tournament t = tm.CreateNewTourney(_t); return(JsonConvert.SerializeObject(t)); }
public void TournamentDbIntegration() { Tournament t = new Tournament(); Tournament res = new Tournament(); t.host.username = "******"; t.host.email = "*****@*****.**"; t.numParticipants = 4; t.tname = GetRandomAlphaNumeric(); t.commaDlParts = "1,2,3,4"; TourneyManager test = new TourneyManager(); res = test.CreateNewTourney(t); //Assert.IsTrue(test.GetTournament(res.tid).tname == t.tname); }
public void AddManager(UserInfo _data, TourneyInt _t) { TourneyManager tm = new TourneyManager(); tm.UpdatePlevel(_data.email, _t.tid, 1); }
public void UpdateMatchup(Matchup match, TourneyInt _t) { TourneyManager tm = new TourneyManager(); tm.UpdateMatchup(match, _t.tid); }