Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
third
package com.testharness;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
public class InverterTest {
@Test
public void shouldInvert() {
String inverted = Inverter.invert(null);
Assert.fail();
}
@Test
public void shouldInverta() {
String inverted = Inverter.invert("a");
assertEquals(inverted,"a");
}
@Test
public void testReverseStringSwap() {
assertEquals(Inverter.invert("abcd"), "dcba");
assertNotEquals(Inverter.invert("abcd"), "dcbb");
assertEquals(Inverter.invert(""), "");
}
@Test
public void testInvert() {
assertEquals("result", Inverter.invert("s"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment