Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 802 Bytes

File metadata and controls

24 lines (17 loc) · 802 Bytes

Java_JUnit

Project developed to start studies on Unit Tests in java with JUnit.

Calculator:

A class called Calculator was created, and it contains the methods:
Addition, subtraction, multiplication and division.

Tests are run in the TestCalculator class. There I used the
annotations:
@BeforeAll --> For executing a block of code before all others
@DisplayName --> Used to name the test
@Test --> To identify the method as a test for JUnit
@AfterEach --> For executing code after each unit test

Vote

A class named Vote was created with the "rule" method. 
This method receveives an "age" parameter to return if at this age
the person Cannot, Can or Must vote according to the brazillian
polices.

Vote tests are in TestVote.java file.