Skip to content

Commit

Permalink
Wrote the first test
Browse files Browse the repository at this point in the history
  • Loading branch information
olekscode committed Jul 10, 2023
1 parent e452bc1 commit a96a957
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Cormas-OpenMole-Tests/CMOpenMoleBridgeTest.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
Class {
#name : #CMOpenMoleBridgeTest,
#superclass : #TestCase,
#instVars : [
'model'
],
#category : #'Cormas-OpenMole-Tests'
}

{ #category : #running }
CMOpenMoleBridgeTest >> setUp [

super setUp.

model := CMMockModel new.
model class activeProbes: model class probes.


]

{ #category : #tests }
CMOpenMoleBridgeTest >> testLastDataOfModel [

| data expectedData |

model initializeSimulation.
5 timesRepeat: [ model runStep ].

data := CMOpenMoleBridge lastDataOfModel: model.

expectedData := {
#numberOfAliveAgents -> model class defaultNumberOfAgents .
#numberOfDeadAgents -> 0 } asDictionary.

self assert: data equals: expectedData.
]
7 changes: 7 additions & 0 deletions src/Cormas-OpenMole/CMAbstractModel.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #CMAbstractModel }

{ #category : #'*Cormas-OpenMole' }
CMAbstractModel >> runOpenMoleSimulation [

"TODO"
]

0 comments on commit a96a957

Please sign in to comment.