mirror of
https://bitbucket.org/Mattrixwv/projecteulerjava.git
synced 2025-12-06 17:13:58 -05:00
Finished adding tests
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package com.mattrixwv.project_euler.problems;
|
||||
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.InjectMocks;
|
||||
|
||||
import com.mattrixwv.project_euler.exceptions.Unsolved;
|
||||
|
||||
|
||||
public class TestProblem41 extends BaseTest{
|
||||
@InjectMocks
|
||||
private Problem41 problem;
|
||||
static{
|
||||
description = "What is the largest n-digit pandigital prime?";
|
||||
result = "The largest n-digit pandigital prime is 7652413";
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Order(1)
|
||||
@Override
|
||||
public void testDescription(){
|
||||
super.testDescription(problem);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(2)
|
||||
@Override
|
||||
public void testSolve(){
|
||||
assertThrows(Unsolved.class, () -> { problem.getLargestPrimePandigital(); });
|
||||
|
||||
super.testSolve(problem);
|
||||
|
||||
//Verify result
|
||||
assertEquals(7652413L, problem.getLargestPrimePandigital());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(3)
|
||||
@Override
|
||||
public void testReset(){
|
||||
super.testReset(problem);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user