Moved the gradient test to its corresponding file.