Skip to content

bispo-daniel/Java_JUnit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

aa87077 · May 21, 2023

History

3 Commits
May 2, 2023
May 21, 2023
May 21, 2023
May 2, 2023
May 2, 2023
May 2, 2023
May 2, 2023
May 2, 2023

Repository files navigation

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.