restructured magnet field tests

changed If statement for in magnetic field tests.