Files
Java/src/test/java/com/thealgorithms/maths/ArmstrongTest.java
Appari Satya Barghav a3a2d845d5 Made changes to the code to correct the Logic of Armstrong Number (#4619)
* Made changes to the code to correct the Logic of Armstrong Number

* Resolved the issues

* Trying to resolve the Linter error by changing Variable name

* Changed Variable Names : trying to resolve Clang error
2023-10-04 20:02:49 +05:30

26 lines
756 B
Java

package com.thealgorithms.maths;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
/**
* @author satyabarghav
* @since 4/10/2023
*/
class ArmstrongTest {
@Test
void testIsArmstrong() {
Armstrong armstrong = new Armstrong();
assertThat(armstrong.isArmstrong(0)).isTrue();
assertThat(armstrong.isArmstrong(1)).isTrue();
assertThat(armstrong.isArmstrong(153)).isTrue();
assertThat(armstrong.isArmstrong(371)).isTrue();
assertThat(armstrong.isArmstrong(1634)).isTrue();
assertThat(armstrong.isArmstrong(200)).isFalse();
assertThat(armstrong.isArmstrong(548834)).isTrue();
assertThat(armstrong.isArmstrong(9474)).isTrue();
}
}