Tests for factory.