Last active
November 17, 2018 06:56
-
-
Save joshden/7218f491a5a03e20065dda023d9915a8 to your computer and use it in GitHub Desktop.
Simple example of unit test class for JUnit 4
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
package com.example; | |
import org.junit.Test; | |
import static org.junit.Assert.*; | |
public class PersonTest { | |
@Test | |
public void testGetDisplayName() { | |
Person person = new Person("Josh", "Hayden"); | |
String displayName = person.getDisplayName(); | |
assertEquals("Hayden, Josh", displayName); | |
} | |
} |
The only difference between this code and the jUnit5 code in your Toptal blog post is the public modifier. Correct?
Yeah, looks like it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The only difference between this code and the jUnit5 code in your Toptal blog post is the public modifier. Correct?