public void Can_get_existing_role_by_id() { IRoleRepository repository = new RoleRepository(); var fromDb = repository.GetById(_roles[1].RoleId); Assert.IsNotNull(fromDb); Assert.AreNotSame(_roles[1], fromDb); Assert.AreEqual(_roles[1].RoleName, fromDb.RoleName); }
private void DeleteInitialData() { IRoleRepository repository = new RoleRepository(); foreach (var role in _roles) { Role fromDb = repository.GetById(role.RoleId); if (fromDb != null) { repository.Remove(role); } } }