Influence of testing parameters on the corrosion rate of magnesium alloys