BAEL-2393: Longest Sub-string without repeating characters.

This commit is contained in:
akash.pandey
2018-11-26 23:02:44 +05:30
parent 5aef6d9d6b
commit 09261fb3b9
2 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package com.baeldung.algorithms.string;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class LongestSubstringNonRepeatingCharactersTest {
@Test
void givenString_whenGetNonRepeatingCharactersBruteForceCalled_thenResultFoundAsExpected() {
String input = "CODINGISAWESOME";
Assertions.assertEquals("NGISAWE", LongestSubstringNonRepeatingCharacters.getNonRepeatingCharactersBruteForce(input));
}
@Test
void givenString_whenGetNonRepeatingCharactersCalled_thenResultFoundAsExpected() {
String input = "CODINGISAWESOME";
Assertions.assertEquals("NGISAWE",LongestSubstringNonRepeatingCharacters.getNonRepeatingCharacters(input));
}
}