Skip to content

Instantly share code, notes, and snippets.

@praser
Created December 27, 2018 19:47
Show Gist options
  • Save praser/77a2048fca0228f20b4abd586272fe1d to your computer and use it in GitHub Desktop.
Save praser/77a2048fca0228f20b4abd586272fe1d to your computer and use it in GitHub Desktop.
Exemplo TDD - Modificando a classe Comissao para atender a todos os cenários
public class Comissao {
private final double BASE_CALCULO_COMISSAO = 10000;
public double calcularComissao(double valorVenda) {
double aliquotaComissao;
aliquotaComissao = valorVenda <= BASE_CALCULO_COMISSAO ? 0.05 : 0.08;
return valorVenda * aliquotaComissao;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment