Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a65d23b

Browse files
committedJul 16, 2018
SeriesInfoExtractorServiceImpl.extractMichelNumbers(): add unit test.
Fix #903
1 parent caefcdd commit a65d23b

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
 

‎src/main/java/ru/mystamps/web/service/SeriesInfoExtractorServiceImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ protected Boolean extractPerforated(String fragment) {
267267
return null;
268268
}
269269

270-
// @todo #694 SeriesInfoExtractorServiceImpl.extractMichelNumbers(): add unit tests
271270
// @todo #694 SeriesInfoExtractorServiceImpl: support for a single Michel number
272271
// @todo #694 SeriesInfoExtractorServiceImpl: support for a comma separated Michel numbers
273272
protected Set<String> extractMichelNumbers(String fragment) {

‎src/test/groovy/ru/mystamps/web/service/SeriesInfoExtractorServiceImplTest.groovy

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,23 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
377377
'БЕЗЗУБЦОВЫЕ' | _
378378
}
379379

380+
//
381+
// Tests for extractMichelNumbers()
382+
//
383+
384+
@Unroll
385+
def 'extractMichelNumbers() should extract "#expected" from "#fragment"'(String fragment, Set<String> expected) {
386+
expect:
387+
service.extractMichelNumbers(fragment) == expected
388+
where:
389+
fragment || expected
390+
nullOrBlank() || []
391+
'# 1-3' || [ '1', '2', '3' ]
392+
'#9997-9999' || [ '9997', '9998', '9999' ]
393+
'#9999-9997' || []
394+
'#0997-0999' || []
395+
}
396+
380397
//
381398
// Tests for extractSeller()
382399
//

0 commit comments

Comments
 (0)
Please sign in to comment.