testes com o padrão factory method