Add factory tests