public IHttpActionResult addClerck(USERS_DTO user) { try { UserCRUD.Create(user); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public void WhenAddingAUsers_UsersTableCountIsIncrementedByOne() { int beforeCount = 0; int afterCount = 0; using (var db = new PosContext()) { beforeCount = db.Users.Count(); userCRUD.Create("Manager", TestUser.UserName, TestUser.UserPassword, TestUser.StartDate); afterCount = db.Users.Count(); } Assert.AreEqual(beforeCount + 1, afterCount); }
public ActionResult <Usuario> Create(Usuario usuario) { userCRUD.Create(usuario); return(CreatedAtRoute("GetBook", new { id = usuario.ID.ToString() }, usuario)); }