public void CanARoleBeUpdated() { var maxid = _testRepo.FindAll().Min(m => m.roleid); Role a = new Role() { roleid = maxid, title = $"Some text from text from test{maxid}", permissions = new List <RolePermissions>(), }; a.permissions.Add(new RolePermissions() { keyid = "Some Role Name", value = "Some value to the role name" } ); a.permissions.Add(new RolePermissions() { keyid = "Some other Role Name", value = "Some other value to the role name" } ); _testRepo.Update(a); var updatedRole = _testRepo.FindByID(maxid); Assert.AreEqual(a.title, updatedRole.title); }
public IActionResult GetRole(int id) { return(Ok(RoleRepo.FindByID(id))); }