Exemplo n.º 1
0
        public void CheckUpdate()
        {
            PlayerDao pd = new PlayerDao(database);

            int i       = 0;
            int player1 = 0;
            int player2 = 0;
            int player3 = 0;

            foreach (Player p in pd.FindAll())
            {
                ++i;
                switch (i)
                {
                case 1:
                    player1 = p.ID;
                    break;

                case 2:
                    player2 = p.ID;
                    break;

                case 3:
                    player3 = p.ID;
                    break;
                }
            }
            Random rand    = new Random();
            int    randVal = rand.Next();
            int    res     = dao.Insert(new Team("teamname" + randVal, player1, player2));
            Team   t       = dao.FindById(res);

            t.Player2ID = player3;
            dao.Update(t);

            Team t2 = dao.FindById(res);

            Assert.IsTrue(t2.Player1ID == t.Player1ID);
            Assert.IsTrue(t2.Player2ID == t.Player2ID);
        }
Exemplo n.º 2
0
        public void Update(Team team)
        {
            ITeamDao TeamDao = DalFactory.CreateTeamDao(database);

            TeamDao.Update(team);
        }