public void TcUpdatePGroupRole() { List <Role> listRole = _provider.getAllRole(); List <Role> role = new List <Role>(); listRole[0].Checked = true; listRole[1].Checked = true; role.Add(listRole[0]); role.Add(listRole[1]); Assert.AreEqual(_provider.updatePGroupRole(4, role.ToArray()), true); Assert.AreEqual(_provider.updatePGroupRole(1000, role.ToArray()), false); }
public JsonResult UpdatePGoupRole(int ID, Role[] ListRole) { try { return(Json(new { success = _provider.updatePGroupRole(ID, ListRole) })); } catch (Exception ex) { return(Json(new { success = false, content = ex.Message.ToString() })); } }