Skip to content

Instantly share code, notes, and snippets.

@MoriTanosuke
Created October 7, 2010 16:26
Show Gist options
  • Save MoriTanosuke/615391 to your computer and use it in GitHub Desktop.
Save MoriTanosuke/615391 to your computer and use it in GitHub Desktop.
package de.kopis.katas;
public class CoverMeSimple {
public int simple(int x, int y) {
int z = x;
if(y > x)
z = y;
z *= 2;
return z;
}
}
package de.kopis.katas;
import static org.junit.Assert.assertEquals;
import mockit.integration.junit4.JMockit;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(JMockit.class)
public class CoverMeSimpleTest {
@Test
public void testSimple() {
CoverMeSimple cm = new CoverMeSimple();
int result = cm.simple(1, 2);
assertEquals(4, result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment