Skip to content
Snippets Groups Projects
Commit a3eaeb80 authored by Karen Grigoriantc's avatar Karen Grigoriantc
Browse files

parent bf6c6ff1
No related branches found
No related tags found
1 merge request!2
package cz.fel.cvut.ts1;
public class Factorial {
public long Factorial (int n){
int result=1,i=1;
while(i<=n){
result=result*i;
i++;
}
return result;
}
}
package cz.fel.cvut.ts1;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class Proj1Test {
@Test
public void factorialTest() {
Proj1 proj = new Proj1();
long expResult = 6;
int num = 3;
long result = proj.factorial(num);
Assertions.assertEquals(expResult, result);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment