public void IncrementValue() { TournamentDao td = new TournamentDao(database); var list = td.FindAll(); int tId = list[0].ID; Assert.IsNotNull(tId); PlayerDao pd = new PlayerDao(database); var plist = pd.FindAll(); int p1id = plist[0].ID; int p2id = plist[1].ID; int p3id = plist[2].ID; int p4id = plist[3].ID; Match m = new Match(p1id, p2id, p3id, p4id, tId, 1, 1, false); int i = dao.Insert(m); SocketObj obj = new SocketObj(); obj.match = i; obj.team = 1; int?i1 = m.ResultPointsPlayer1; BLMatch.IncrementValue(obj); Match m1 = dao.FindById(i); int? i2 = m1.ResultPointsPlayer1; Assert.AreEqual(i1, i2 - 1); }
public HttpResponseMessage FindById(int id) { //if (Authentication.getInstance().isAuthenticateWithHeader(Request)) //{ IMatchDao MatchDao = DalFactory.CreateMatchDao(database); return(Request.CreateResponse <Match>(HttpStatusCode.OK, MatchDao.FindById(id))); //} //else //{ // return Request.CreateResponse(HttpStatusCode.Forbidden); //} }