Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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 {
public void shouldInvert() {
String inverted = Inverter.invert(null);;
public void shouldInverta() {
String inverted = Inverter.invert("a");
public void testReverseStringSwap() {
assertEquals(Inverter.invert("abcd"), "dcba");
assertNotEquals(Inverter.invert("abcd"), "dcbb");
assertEquals(Inverter.invert(""), "");
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