Design, development and experiment of a 1.5 T MgB2 superconducting test magnet