Last active
April 20, 2017 00:31
-
-
Save luksrn/952a3f19ecec1d28ba59c6e16914076b to your computer and use it in GitHub Desktop.
Baseado no exemplo https://github.com/junit-team/junit5-samples/blob/master/junit5-gradle-consumer/src/test/java/com/example/project/FirstTest.java
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
import static org.junit.jupiter.api.Assertions.assertEquals; | |
import org.junit.jupiter.api.DisplayName; | |
import org.junit.jupiter.api.Tag; | |
import org.junit.jupiter.api.Test; | |
import org.junit.jupiter.api.TestInfo; | |
@Tag("fast") | |
class FirstTest { | |
@Test | |
@DisplayName("My 1st JUnit 5 test! 😎") | |
void myFirstTest(TestInfo testInfo) { | |
Calculator calculator = new Calculator(); | |
assertEquals(2, calculator.add(1, 1), "1 + 1 should equal 2"); | |
assertEquals("My 1st JUnit 5 test! 😎", testInfo.getDisplayName(), () -> "TestInfo is injected correctly"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment