public void DeleteUserErrorTest() { ProjectManagerBL tb = new ProjectManagerBL(dbContext.Object); string result = ""; try { tb.DeleteUser(3); } catch (Exception ex) { result = ex.Message; } Assert.AreEqual(result, "ERROR:User is in use for Task or Project."); }
public void TestMethod5_DeleteUser() { UserModel usr = new UserModel() { EmployeeId = 100, FirstName = "Animesh", LastName = "Singh", UserId = 100 }; Mock <IProjectDbService> mock = new Mock <IProjectDbService>(); ProjectManagerBL projBL = new ProjectManagerBL(mock.Object); projBL.DeleteUser(usr); mock.Verify(c => c.DeleteUser(It.IsAny <Usr>()), Times.Once); }
public void DeleteUserSuccessTest() { Users newUser = new Users() { UserId = 4, EmployeeId = "IT004", FirstName = "Robert", LastName = "Jose" }; ProjectManagerBL tb = new ProjectManagerBL(dbContext.Object); tb.AddUser(newUser); string result = tb.DeleteUser(10); Assert.AreEqual(result, "Users Deleted Successfully"); }
// DELETE: api/TaskManager/5 public void DeleteUser(int id) { ProjectManagerBL taskManagerBL = new ProjectManagerBL(); taskManagerBL.DeleteUser(id); }
public IHttpActionResult DeleteUser(int id) { ProjectManagerBL obj = new ProjectManagerBL(_db); return(Ok(obj.DeleteUser(id))); }
public void Delete(int id) { pbl.DeleteUser(id); }