Add tests for factory methods.