Construction and Test of the Magnets for the AEgIS Experiment