Skip to content

Commit

Permalink
Separated stress tests into adding and querying
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabacman committed Jan 9, 2024
1 parent 56ae176 commit 41ee693
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions source/Sagan-Core-Tests/RepositoryBasedTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,22 @@ RepositoryBasedTest >> sistineStallone [
^ self extraterrestrialNamedFirst: 'Sistine' last: 'Stallone' bornOn: (Date year: 1998 month: 6 day: 27)
]

{ #category : 'tests - management' }
RepositoryBasedTest >> testAddLargeNumberOfObjects [

self
should: [
1000 timesRepeat: [
self extraterrestrials
store: self johnTravolta;
store: self johnLock;
store: self silvesterStallone;
store: self ellaTravolta
]
]
notTakeMoreThan: 6 seconds
]

{ #category : 'tests - querying' }
RepositoryBasedTest >> testCountMatching [

Expand Down Expand Up @@ -228,6 +244,20 @@ RepositoryBasedTest >> testFindAllMatchingSortedByBirthDate [
assert: sorted last firstName equals: 'John'
]

{ #category : 'tests - querying' }
RepositoryBasedTest >> testFindAllMatchingWhenCollectionIsLarge [

self testAddLargeNumberOfObjects.
self
should: [
self
assert: ( self extraterrestrials findAllMatching: [ :extraterrestrial |
extraterrestrial firstName = 'Silvester' ] ) size
equals: 1000
]
notTakeMoreThan: 1 second
]

{ #category : 'tests - management' }
RepositoryBasedTest >> testPurge [

Expand Down

0 comments on commit 41ee693

Please sign in to comment.