Last active
December 3, 2023 17:43
-
-
Save eliasnogueira/12cb6f9f064f308adac5185c6a44e7ff to your computer and use it in GitHub Desktop.
Example of a test validating the constants of Simulation
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
class SimulationTest { | |
@Test | |
void basicCheck() { | |
Simulation simulation = Simulation.builder().name("Elias").cpf("123456").email("[email protected]") | |
.amount(new BigDecimal(1000)).installments(48).insurance(false).build(); | |
SoftAssertions.assertSoftly(softly -> { | |
softly.assertThat(simulation.getName()).isEqualTo("Elias"); | |
softly.assertThat(simulation.getCpf()).isNotEmpty(); | |
softly.assertThat(simulation.getEmail()).isEqualTo("[email protected]"); | |
softly.assertThat(simulation.getAmount()).usingComparator(BigDecimal::compareTo).isBetween(new BigDecimal(1000), new BigDecimal(40000)); | |
softly.assertThat(simulation.getInstallments()).isBetween(2, 48); | |
softly.assertThat(simulation.getInsurance()).isFalse(); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment