Skip to content

Instantly share code, notes, and snippets.

@GuilhermeManzano
Created November 20, 2020 03:22
Show Gist options
  • Save GuilhermeManzano/476243e5c5d0fdd292c5a6ebb8da12ef to your computer and use it in GitHub Desktop.
Save GuilhermeManzano/476243e5c5d0fdd292c5a6ebb8da12ef to your computer and use it in GitHub Desktop.
@Test
public void testLocacao_filmeSemEstoque_2(){
// cenario
LocacaoService service = new LocacaoService();
Usuario usuario = new Usuario("Usuario 1");
Filme filme = new Filme("Filme 1", 2, 5.0);
// açao
try {
service.alugarFilme(usuario, filme);
Assert.fail("Deveria ter lançado uma exceção");
} catch (Exception e) {
Assert.assertThat(e.getMessage(), is("Filme sem estoque"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment