Update test coverage

This commit is contained in:
2023-06-30 21:53:33 -04:00
parent 43a7e41391
commit 6c1f06e916

View File

@@ -264,13 +264,8 @@ public class NumberAlgorithms{
//If for some reason the goalNumber is not 1 throw an error //If for some reason the goalNumber is not 1 throw an error
if(goalNumber != 1){ if(goalNumber != 1){
if(isPrime(goalNumber)){
factors.add(goalNumber); factors.add(goalNumber);
} }
else{
throw new InvalidResult("The factor was not 1: " + goalNumber);
}
}
//Return the list of factors //Return the list of factors
return factors; return factors;
@@ -303,13 +298,8 @@ public class NumberAlgorithms{
//If for some reason the goalNumber is not 1 throw an error //If for some reason the goalNumber is not 1 throw an error
if(!goalNumber.equals(BigInteger.ONE)){ if(!goalNumber.equals(BigInteger.ONE)){
if(isPrime(goalNumber)){
factors.add(goalNumber); factors.add(goalNumber);
} }
else{
throw new InvalidResult("The factor was not 1: " + goalNumber);
}
}
//Return the list of factors //Return the list of factors
return factors; return factors;