Esempio n. 1
0
        public string GetAllTourneys(UserInfo _data)
        {
            TourneyManager tm = new TourneyManager();
            TournamentList tl = tm.GetAllTourneys(_data.username);

            return(JsonConvert.SerializeObject(tl));
        }
Esempio n. 2
0
        public string GetTourney(UserInfo _data, TourneyInt _t)
        {
            TourneyManager tm = new TourneyManager();
            Tournament     t  = tm.GetTournament(_data.username, _t.tid);

            return(JsonConvert.SerializeObject(t));
        }
Esempio n. 3
0
        public void GetAllTourneysTest()
        {
            string         username = GetRandomAlphaNumeric();
            TourneyManager test     = new TourneyManager();
            TournamentList tl       = test.GetAllTourneys(username);

            Assert.IsNotNull(tl);
        }
Esempio n. 4
0
        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());
        }
Esempio n. 5
0
        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);
        }
Esempio n. 7
0
        public void AddManager(UserInfo _data, TourneyInt _t)
        {
            TourneyManager tm = new TourneyManager();

            tm.UpdatePlevel(_data.email, _t.tid, 1);
        }
Esempio n. 8
0
        public void UpdateMatchup(Matchup match, TourneyInt _t)
        {
            TourneyManager tm = new TourneyManager();

            tm.UpdateMatchup(match, _t.tid);
        }