BAEL-227 - Renaming test to follow BDD convention

This commit is contained in:
Slavisa Baeldung 2016-08-05 12:17:09 +02:00
parent 4e1a0d478d
commit 2225509d83
1 changed files with 8 additions and 3 deletions

View File

@ -8,21 +8,26 @@ import org.junit.Test;
import com.baeldung.testing.mutation.Palindrome; import com.baeldung.testing.mutation.Palindrome;
public class TestPalindrome { public class TestPalindrome {
@Test @Test
public void acceptsPalindrome() { public void whenEmptyString_thanAccept() {
Palindrome palindromeTester = new Palindrome(); Palindrome palindromeTester = new Palindrome();
assertTrue(palindromeTester.isPalindrome("noon")); assertTrue(palindromeTester.isPalindrome("noon"));
} }
@Test @Test
public void rejectsNonPalindrome(){ public void whenPalindrom_thanAccept() {
Palindrome palindromeTester = new Palindrome();
assertTrue(palindromeTester.isPalindrome("noon"));
}
@Test
public void whenNotPalindrom_thanReject(){
Palindrome palindromeTester = new Palindrome(); Palindrome palindromeTester = new Palindrome();
assertFalse(palindromeTester.isPalindrome("box")); assertFalse(palindromeTester.isPalindrome("box"));
} }
@Test @Test
public void rejectsNearPalindrome(){ public void whenNearPalindrom_thanReject(){
Palindrome palindromeTester = new Palindrome(); Palindrome palindromeTester = new Palindrome();
assertFalse(palindromeTester.isPalindrome("neon")); assertFalse(palindromeTester.isPalindrome("neon"));
} }