-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide tests and data structure for bam and pod5 registration
- Loading branch information
1 parent
d43dd4a
commit a472f51
Showing
6 changed files
with
345 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/test/groovy/life/qbic/datamodel/datasets/datastructure/files/nanopore/BamFileSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package life.qbic.datamodel.datasets.datastructure.files.nanopore | ||
|
||
import spock.lang.Specification | ||
|
||
/** | ||
* <add class description here> | ||
* | ||
*/ | ||
class BamFileSpec extends Specification { | ||
|
||
def "shall create a BamFile instance"() { | ||
given: | ||
final name = "test_file.bam" | ||
final relativePath = "root/test_file.bam" | ||
|
||
when: | ||
def dataObject = BamFile.create(name, relativePath) | ||
|
||
then: | ||
assert dataObject instanceof BamFile | ||
assert dataObject.relativePath == relativePath | ||
assert dataObject.name == name | ||
} | ||
|
||
def "name not matching schema shall throw IllegalArgumentException"() { | ||
given: | ||
final name = "test_file.bum" | ||
final relativePath = "root/test_file.bum" | ||
|
||
when: | ||
def dataObject = BamFile.create(name, relativePath) | ||
|
||
then: | ||
thrown(IllegalArgumentException) | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...test/groovy/life/qbic/datamodel/datasets/datastructure/files/nanopore/Pod5FileSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package life.qbic.datamodel.datasets.datastructure.files.nanopore | ||
|
||
import spock.lang.Specification | ||
|
||
/** | ||
* <add class description here> | ||
* | ||
*/ | ||
class Pod5FileSpec extends Specification { | ||
|
||
def "shall create a Pod5 instance"() { | ||
given: | ||
final name = "test_file.pod5" | ||
final relativePath = "root/test_file.pod5" | ||
|
||
when: | ||
def dataObject = Pod5File.create(name, relativePath) | ||
|
||
then: | ||
assert dataObject instanceof Pod5File | ||
assert dataObject.relativePath == relativePath | ||
assert dataObject.name == name | ||
} | ||
|
||
def "name not matching schema shall throw IllegalArgumentException"() { | ||
given: | ||
final name = "test_file.pad4" | ||
final relativePath = "root/test_file.pad4" | ||
|
||
when: | ||
def dataObject = Pod5File.create(name, relativePath) | ||
|
||
then: | ||
thrown(IllegalArgumentException) | ||
} | ||
|
||
} |
Oops, something went wrong.