Question: Question 2 . 1 ( 2 5 % ) partir de la description des r gles de validation et de formatage des ISBN ainsi que
Question
partir de la description des rgles de validation et de formatage des ISBN ainsi que
de la signature de la mthode cidessus, fournissez un plan de test botenoire pour la
mthode tidyISBNorInsertingDashes en utilisant l'approche du partitionnement
en catgories Votre plan de test doit bien montrer les paramtres conditions de
l'environnement, catgories choix et contraintes du problme Rapportez vos
rsultats dans une table suivant le format suivant: Here is the code for the method:
Tidies up an ISBN by first removing stray dashes and
nonnumerics. Validates checksum, checks publisher number, and inserts dashes
where they belong. Discards
whatever it finds before or after the ISBN.
@param rawISBNor rawISBN text to be tidied, possibly with extra dashes,
spaces or other junk chars.
@return tidied dashed ISBN with lead and trail junk discarded. or an error
message if the ISBN is invalid.
public static String tidyISBNorInsertingDashesString rawISBNor
if rawISBNor null rawISBNorlength
throw new IllegalArgumentExceptionno ISBN";
strip lead, trail and embedded junk including dashes
final String dashlessISBN striprawISBNor;
final int length dashlessISBN.length;
switch length
case :
ensureISBNValiddashlessISBN;
return insertDashesInISBNordashlessISBN;
case :
ensureISBNValiddashlessISBN;
return insertDashesInISBNordashlessISBN;
default:
throw new IllegalArgumentException
"ISBN must be or digits long.";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
