Skip to content
Snippets Groups Projects
Commit a63d693f authored by Christopher Bohn's avatar Christopher Bohn :thinking:
Browse files

Added integer version of multiplyByTen

parent 1544b464
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,15 @@ public class TestDemoTarget {
return returnValue;
}
public static int multiplyByTen(int multiplicand) {
double multiplier = 0.0;
for (int i = 0; i < 100; i++) {
multiplier += 0.1;
}
double product = multiplicand * multiplier;
return (int)product;
}
public static double multiplyByTen(double multiplicand) {
double multiplier = 0.0;
for (int i = 0; i < 100; i++) {
......
......@@ -4,6 +4,17 @@ import org.junit.Test;
import static org.junit.Assert.*;
public class TestDemoTests {
@Test
public void testMultiplyZero() {
// arrange
int value = 0;
int expectedResult = 0;
// act
int actualResult = TestDemoTarget.multiplyByTen(value);
// assert
assertEquals(expectedResult, actualResult);
}
@Test
public void testIntegerFirstValueIsGreater() {
// arrange
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment