Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98a52a1
commit fe03c4d
Showing
7 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package fa7.storys; | ||
|
||
import fa7.storys.steps.ClienteAdicionaProdutoAoCarrinhoSteps; | ||
|
||
public class ClienteAdicionaProdutoAoCarrinho extends JUnitStoryFA7 { | ||
public ClienteAdicionaProdutoAoCarrinho() { | ||
object = this; | ||
objectSteps = new ClienteAdicionaProdutoAoCarrinhoSteps(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Scenario: Cliente Adiciona ao carrinho | ||
|
||
Given que Joaozinho esta logado | ||
Given que Joaozinho tem um carrinho | ||
When um bilhete eh adicionado ao carrinho | ||
Then o bilhete deve estar no carrinho | ||
|
36 changes: 36 additions & 0 deletions
36
src/fa7/storys/steps/ClienteAdicionaProdutoAoCarrinhoSteps.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package fa7.storys.steps; | ||
|
||
import org.jbehave.core.annotations.Given; | ||
import org.jbehave.core.annotations.Then; | ||
import org.jbehave.core.annotations.When; | ||
import org.junit.Assert; | ||
|
||
import fa7.domain.Cliente; | ||
|
||
public class ClienteAdicionaProdutoAoCarrinhoSteps { | ||
|
||
private Cliente clienteObj; | ||
|
||
@Given("que $nomeCliente esta logado") | ||
public void estaLogado(String nomeCliente) { | ||
clienteObj = new Cliente(); | ||
clienteObj.setName(nomeCliente); | ||
Assert.assertTrue(clienteObj.logar()); | ||
} | ||
|
||
@Given("que $cliente tem um carrinho") | ||
public void temUmCarrinho(String cliente){ | ||
Assert.assertNotNull(clienteObj.getCarrinho()); | ||
} | ||
|
||
@When("um $produto eh adicionado ao carrinho") | ||
public void adicionarBilheteAocarrinho(String produto){ | ||
clienteObj.getCarrinho().add(produto); | ||
} | ||
|
||
@Then("o $produto deve estar no carrinho") | ||
public void verificarProdutoNoCarrinho(String produto) { | ||
Assert.assertTrue(clienteObj.getCarrinho().contains(produto)); | ||
} | ||
|
||
} |
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