MCPcopy Create free account
hub / github.com/DiUS/java-faker / testIsbn13

Method testIsbn13

src/test/java/com/github/javafaker/CodeTest.java:52–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50 }
51
52 @Test
53 @Repeat(times = 1000)
54 public void testIsbn13() {
55 final String isbn13NoSep = faker.code().isbn13(false);
56 final String isbn13Sep = faker.code().isbn13(true);
57
58 assertThat(isbn13NoSep + " is not null", isbn13NoSep, is(not(nullValue())));
59 assertThat(isbn13NoSep + " has length of 13", isbn13NoSep.length(), is(13));
60 assertIsValidISBN13(isbn13NoSep);
61
62 assertThat(isbn13Sep + " is not null", isbn13Sep, is(not(nullValue())));
63 assertThat(isbn13Sep + " has length of 17", isbn13Sep.length(), is(17));
64 assertIsValidISBN13(isbn13Sep);
65 }
66
67 private void assertIsValidISBN10(String isbn10) {
68 assertThat(isbn10 + " is valid", ISBN_VALIDATOR.isValidISBN10(isbn10), is(true));

Callers

nothing calls this directly

Calls 3

assertIsValidISBN13Method · 0.95
isbn13Method · 0.80
codeMethod · 0.45

Tested by

no test coverage detected