This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
História do usuário: | |
Eu enquanto gerente da loja de carros | |
Gostaria de calcular a comissão de vendas | |
Para poder pagar os vendedores corretamente | |
Critérios de aceitação: | |
Dado que um vendedor fez uma venda de R$ 10.000,00 | |
E que o valor da comissão para vendas até R$ 10.000,00 é de 5% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.junit.jupiter.api.Assertions.assertEquals; | |
import org.junit.jupiter.api.Test; | |
public class ComissaoTeste { | |
@Test | |
public void testeUmaVendaDeDezMilPagaComissaoDeQuinhentos() { | |
//Arrange | |
Comissao comissao = new Comissao(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Comissao { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Comissao { | |
public double calcularComissao(double valorVenda) { | |
return 0; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Comissao { | |
public double calcularComissao(double valorVenda) { | |
return 500; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.junit.jupiter.api.Assertions.assertEquals; | |
import org.junit.jupiter.api.Test; | |
public class ComissaoTeste { | |
@Test | |
public void testeUmaVendaDeDezMilPagaComissaoDeQuinhentos() { | |
//Arrange | |
Comissao comissao = new Comissao(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Comissao { | |
public double calcularComissao(double valorVenda) { | |
double comissao; | |
if (valorVenda <= 10000) { | |
comissao = 500; | |
} else { | |
comissao = 800.08; | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Comissao { | |
private final double BASE_CALCULO_COMISSAO = 10000; | |
public double calcularComissao(double valorVenda) { | |
return valorVenda <= BASE_CALCULO_COMISSAO ? 500 : 800.08; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.junit.jupiter.api.Assertions.assertEquals; | |
import org.junit.jupiter.api.Test; | |
public class ComissaoTeste { | |
@Test | |
public void testeUmaVenda10000_00PagaComissaoDe500_00() { | |
//Arrange | |
Comissao comissao = new Comissao(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.junit.jupiter.api.Assertions.assertEquals; | |
import org.junit.jupiter.api.Test; | |
public class ComissaoTeste { | |
@Test | |
public void testeUmaVenda10000_00PagaComissaoDe500_00() { | |
//Arrange | |
Comissao comissao = new Comissao(); |
OlderNewer