Add tests for FromPrimitive trait