Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jtmonument committed Jun 9, 2022
2 parents ba5cdda + ba3c031 commit 7df76e6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/java/com/thealgorithms/maths/FactorialTest.java
@@ -0,0 +1,16 @@
package com.thealgorithms.maths;

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;



public class FactorialTest {

@Test
public void test() {
Factorial fact = new Factorial();
assertEquals(120,fact.factorial(5));
}

}
25 changes: 25 additions & 0 deletions src/test/java/com/thealgorithms/maths/SumOfDigitsTest.java
@@ -0,0 +1,25 @@
package com.thealgorithms.maths;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

/**
* @author SirFixalot16
* @since 01/06/22
*/
public class SumOfDigitsTest {
@Test
void isSumOf2Digits() {
SumOfDigits sum = new SumOfDigits();
assertEquals(11, sum.sumOfDigits(56));
}
void isSumOf3Digits() {
SumOfDigits sum = new SumOfDigits();
assertEquals(12, sum.sumOfDigits(192));
}
void isSumOf4Digits() {
SumOfDigits sum = new SumOfDigits();
assertEquals(25, sum.sumOfDigits(8962));
}
}

0 comments on commit 7df76e6

Please sign in to comment.