public List <AdminRoles> GetAllRoles() { Logging.LogDebugMessage("Method: GetAllRoles, MethodType: Get, Layer: RolesController, Parameters: No Input Parameters"); using (RolesBL allRoles = new RolesBL()) { return(allRoles.GetAllRoles()); } }
public void CreateRole_Null_Test() { //get all the roles from the db List <Role> previousRoles = rolesBL.GetAllRoles().ToList <Role>(); //add a new role to the db string roleName = null; rolesBL.AddRole(roleName); List <Role> expectedRoles = new List <Role>(); expectedRoles.AddRange(previousRoles); //add the previous Roles to the list List <Role> actualRoles = rolesBL.GetAllRoles().ToList <Role>(); //check if expected roles with the actual roles are equal AreListsEqual(expectedRoles, actualRoles); }