Created
October 7, 2010 16:26
-
-
Save MoriTanosuke/615391 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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