Skip to content

Commit

Permalink
commit by sachinta
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinthagithub committed Feb 27, 2024
1 parent 5374c08 commit 92a4d23
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 113 deletions.
130 changes: 27 additions & 103 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions src/main/java/org/example/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,7 @@ public int Divide(int param1,int param2)
{
return (param1/param2);
}
public int modulus(int a,int b){return a % b;}

public int squareroot(int a){return (int) Math.sqrt(a);}
public int absoluteValue(int a){return (int) Math.abs(a);}

public int maxValue(int a,int b){return Math.max(a,b);}
public int minValue(int a,int b){return Math.min(a,b);}

public int rountvalue(float a){return (int) Math.round(a);}
public int roundvalue(float param1){return (int) Math.round(param1);}
}


8 changes: 7 additions & 1 deletion src/test/java/TestCalculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ public void testRoundValue(float input, int expected) {
int roundedResult = main.rountvalue(input);
Assertions.assertEquals(expected, roundedResult);
}

@ParameterizedTest
@CsvFileSource(resources = "/TestData_RoundValue.csv")
public void testRound(float param1,int result) //test round value
{
int divround=main.roundvalue(param1);
Assertions.assertEquals(result, divround);
}


}

0 comments on commit 92a4d23

Please sign in to comment.