Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import junit.framework.TestCase;
- public class HomeworkMathTest extends TestCase {
- public void testHomeworkExample() {
- assertEquals(85, HomeworkMath.sumOfSumsOfDigitsInCyclicOrder(582109));
- }
- public void testZero() {
- assertEquals(0, HomeworkMath.sumOfSumsOfDigitsInCyclicOrder(0));
- }
- public void testOneDigit() {
- assertEquals(7, HomeworkMath.sumOfSumsOfDigitsInCyclicOrder(7));
- }
- public void testTwoDigits() {
- assertEquals((1 + 3) + (3), HomeworkMath.sumOfSumsOfDigitsInCyclicOrder(13));
- }
- public void testThreeDigits() {
- assertEquals((1 + 2 + 3) + (2 + 3) + (3), HomeworkMath.sumOfSumsOfDigitsInCyclicOrder(123));
- }
- }
Add Comment
Please, Sign In to add comment