Skip to content

Commit

Permalink
Merge pull request #3 from LucoMoro/DDCommand-test
Browse files Browse the repository at this point in the history
Add tests for DDCommand + subclasses
  • Loading branch information
LucoMoro authored Mar 9, 2024
2 parents d534ee4 + 9af404f commit 9f19943
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/DiscOrDance-Tests/DDCommandTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"
A DDCommandTest is a test class for testing the behavior of DDCommand
"
Class {
#name : #DDCommandTest,
#superclass : #TestCase,
#category : #'DiscOrDance-Tests-Commands'
}

{ #category : #test }
DDCommandTest >> testExecute [
| aCommand |
aCommand := DDCommand new.
self should: [ aCommand execute ] raise: SubclassResponsibility.
]
15 changes: 15 additions & 0 deletions src/DiscOrDance-Tests/DDExploreCleanedCommandTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"
A DDExploreCleanedCommandTest is a test class for testing the behavior of DDExploreCleanedCommand
"
Class {
#name : #DDExploreCleanedCommandTest,
#superclass : #TestCase,
#category : #'DiscOrDance-Tests-Commands'
}

{ #category : #test }
DDExploreCleanedCommandTest >> testModelType [
| aCommand |
aCommand := DDExploreCleanedCommand new.
self assert: aCommand modelType equals: #clean.
]
15 changes: 15 additions & 0 deletions src/DiscOrDance-Tests/DDExploreCommandTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"
A DDExploreCommandTest is a test class for testing the behavior of DDExploreCommand
"
Class {
#name : #DDExploreCommandTest,
#superclass : #TestCase,
#category : #'DiscOrDance-Tests-Commands'
}

{ #category : #test }
DDExploreCommandTest >> testModelType [
| aCommand |
aCommand := DDExploreCommand new.
self should: [ aCommand modelType ] raise: SubclassResponsibility.
]
15 changes: 15 additions & 0 deletions src/DiscOrDance-Tests/DDExploreCustomCommandTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"
A DDExploreCustomCommandTest is a test class for testing the behavior of DDExploreCustomCommand
"
Class {
#name : #DDExploreCustomCommandTest,
#superclass : #TestCase,
#category : #'DiscOrDance-Tests-Commands'
}

{ #category : #tests }
DDExploreCustomCommandTest >> testModelType [
| aCommand |
aCommand := DDExploreCustomCommand new.
self assert: aCommand modelType equals: #custom.
]
15 changes: 15 additions & 0 deletions src/DiscOrDance-Tests/DDExploreRawCommandTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"
A DDExploreRawCommandTest is a test class for testing the behavior of DDExploreRawCommand
"
Class {
#name : #DDExploreRawCommandTest,
#superclass : #TestCase,
#category : #'DiscOrDance-Tests-Commands'
}

{ #category : #test }
DDExploreRawCommandTest >> testModelType [
| aCommand |
aCommand := DDExploreRawCommand new.
self assert: aCommand modelType equals: #raw.
]
28 changes: 28 additions & 0 deletions src/DiscOrDance-Tests/DDScrapeCommandTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"
A DDScrapeCommandTest is a test class for testing the behavior of DDScrapeCommand
"
Class {
#name : #DDScrapeCommandTest,
#superclass : #TestCase,
#category : #'DiscOrDance-Tests-Commands'
}

{ #category : #test }
DDScrapeCommandTest >> testConfiguration [
| aCommand aConfiguration |
aCommand := DDScrapeCommand new.
aConfiguration := DDGlobalConfiguration new.
aCommand configuration: aConfiguration.

self assert: aCommand configuration equals: aConfiguration.
]

{ #category : #tests }
DDScrapeCommandTest >> testNilConfiguration [
| aCommand aConfiguration |
aCommand := DDScrapeCommand new.
aConfiguration := nil.
aCommand configuration: aConfiguration.

self should: [ aCommand configuration ] raise: Error.
]
28 changes: 28 additions & 0 deletions src/DiscOrDance-Tests/DDServerCommandTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"
A DDServerCommandTest is a test class for testing the behavior of DDServerCommand
"
Class {
#name : #DDServerCommandTest,
#superclass : #TestCase,
#category : #'DiscOrDance-Tests-Commands'
}

{ #category : #tests }
DDServerCommandTest >> testNilServerName [
| aCommand |
aCommand := DDServerCommand new.
"aCommand serverName: nil." "This is not necessary."

self should: [aCommand serverName] raise: Error.
]

{ #category : #test }
DDServerCommandTest >> testServerName [
| aCommand |
aCommand := DDServerCommand new.
aCommand serverName: 'server-name'.

self assert: aCommand serverName equals: 'server-name'.


]

0 comments on commit 9f19943

Please sign in to comment.