예제 #1
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());
        }
예제 #2
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);
        }