-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComparerTest.java
More file actions
19 lines (15 loc) · 584 Bytes
/
Copy pathComparerTest.java
File metadata and controls
19 lines (15 loc) · 584 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import static org.junit.Assert.assertEquals;
import com.morgan.stringdiff.Comparer;
import com.morgan.stringdiff.InvalidInputException;
import org.junit.Test;
public class ComparerTest {
@Test
public void characterDifferenceSameLengthStringsReturnsCorrectResult() {
final int diffCount = Comparer.characterDifference("teststring", "taststr1nG");
assertEquals(3, diffCount);
}
@Test(expected = InvalidInputException.class)
public void characterDifferenceDifferentLengthStringsThrowsInvalidInputException() {
Comparer.characterDifference("foo", "foo2");
}
}