Created
November 20, 2020 03:20
-
-
Save GuilhermeManzano/bdbd585c56495a75f5faaae1d6f6ce69 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 LocacaoServiceTest { | |
@Rule | |
public ErrorCollector error = new ErrorCollector(); | |
@Test | |
public void teste() throws Exception { | |
//cenario | |
LocacaoService service = new LocacaoService(); | |
Usuario usuario = new Usuario("Usuario 1"); | |
Filme filme = new Filme("Filme 1", 2, 4.0); | |
//açao | |
Locacao locacao = service.alugarFilme(usuario, filme); | |
//verificacao | |
error.checkThat(locacao.getValor(), is(equalTo(5.0))); | |
error.checkThat(isMesmaData(locacao.getDataLocacao(), new Date()), is(true)); | |
error.checkThat(isMesmaData(locacao.getDataRetorno(), DataUtils.obterDataComDiferencaDias(1)), is(true)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment