public void TestRepositoryAddUserAndValidateRole() { Role role = new Role("admin", "Administrador del sistema"); roleRepository.AddEntity(role); userTest.Roles.Add(role); userRepository.AddEntity(userTest); Role expectedRole = userRepository.GetUserById(userTest.UserId).Roles.Where(r => r.RoleId == role.RoleId).First(); Assert.AreEqual(role, expectedRole); }
public void TestRepositoryAddRole() { roleRepository.AddEntity(roleTest); Assert.IsTrue(roleTest.Equals(roleRepository.GetRoleById(roleTest.RoleId))); }