###Edit 2
Using this SO question we can determine where the collision was. We can then modify our code to be
void OnCollisionEnter2D(Collision2D col) {
transform relativePosition = transform.InverseTransformPoint(collision.contacts);
if (abs(relativePosition.x) > abs(relativePosition.y))
testing.speedX = 0;
else
testing.speedY = 0;
}
void OnCollisionExit2D(Collision2D col) {
testing.speedY = 10F;
testing.speedX = 10F;
}