Pergunta de entrevista da empresa Amazon

Write a method that returns how many time a letter appears in a string. Followed by how would you test it.