Add least common multiple algorithm (#3216)

This commit is contained in:
LauKinHoong
2022-08-17 13:59:07 +08:00
committed by GitHub
parent e87e097f06
commit 3f69603440
3 changed files with 125 additions and 1 deletions

View File

@ -0,0 +1,27 @@
package com.thealgorithms.maths;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class LeastCommonMultipleTest {
/*
* Test for first number greater than second number
*/
@Test
public void testForFirst() {
int result = LeastCommonMultiple.lcm(6,8);
int expected = 24;
Assertions.assertEquals(result, expected);
}
/*
* Test for second number greater than first number
*/
@Test
public void testForSecond() {
int result = LeastCommonMultiple.lcm(8,6);
int expected = 24;
Assertions.assertEquals(result, expected);
}
}