Skip to content

Commit

Permalink
SeriesInfoExtractorServiceImpl.extractMichelNumbers(): add unit test.
Browse files Browse the repository at this point in the history
Fix #903
  • Loading branch information
php-coder committed Jul 16, 2018
1 parent caefcdd commit a65d23b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Expand Up @@ -267,7 +267,6 @@ protected Boolean extractPerforated(String fragment) {
return null;
}

// @todo #694 SeriesInfoExtractorServiceImpl.extractMichelNumbers(): add unit tests
// @todo #694 SeriesInfoExtractorServiceImpl: support for a single Michel number
// @todo #694 SeriesInfoExtractorServiceImpl: support for a comma separated Michel numbers
protected Set<String> extractMichelNumbers(String fragment) {
Expand Down
Expand Up @@ -377,6 +377,23 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
'БЕЗЗУБЦОВЫЕ' | _
}

//
// Tests for extractMichelNumbers()
//

@Unroll
def 'extractMichelNumbers() should extract "#expected" from "#fragment"'(String fragment, Set<String> expected) {
expect:
service.extractMichelNumbers(fragment) == expected
where:
fragment || expected
nullOrBlank() || []
'# 1-3' || [ '1', '2', '3' ]
'#9997-9999' || [ '9997', '9998', '9999' ]
'#9999-9997' || []
'#0997-0999' || []
}

//
// Tests for extractSeller()
//
Expand Down

0 comments on commit a65d23b

Please sign in to comment.