示例#1
0
        public void TestDeleteUser()
        {
            var userTeamMethods   = new UserTeamMethods();
            var lastItemOfTheList = userTeamMethods.Display().LastOrDefault().UserTeamId;

            // Deleta o item e depois verifica se o id do user está nulo
            // estando nulo, significa que foi deletado.
            userTeamMethods.Delete(lastItemOfTheList);
            Assert.IsNull(userTeamMethods.Find(lastItemOfTheList));
        }
 public IHttpActionResult Delete(int id)
 {
     var userTeamMethods = new UserTeamMethods();
     if (userTeamMethods.Find(id) == null)
     {
         return BadRequest("The user could not be found.");
     }
     else
     {
         userTeamMethods.Delete(id);
         return ResponseMessage(new HttpResponseMessage(HttpStatusCode.NoContent));
     }
 }
示例#3
0
        public IHttpActionResult Delete(int id)
        {
            var userTeamMethods = new UserTeamMethods();

            if (userTeamMethods.Find(id) == null)
            {
                return(BadRequest("The user could not be found."));
            }
            else
            {
                userTeamMethods.Delete(id);
                return(ResponseMessage(new HttpResponseMessage(HttpStatusCode.NoContent)));
            }
        }
示例#4
0
 public void TestDeleteUser()
 {
     var userTeamMethods = new UserTeamMethods();
     var lastItemOfTheList = userTeamMethods.Display().LastOrDefault().UserTeamId;
     // Deleta o item e depois verifica se o id do user está nulo
     // estando nulo, significa que foi deletado.
     userTeamMethods.Delete(lastItemOfTheList);
     Assert.IsNull(userTeamMethods.Find(lastItemOfTheList));
 }