From 41ee693647f9eac58c1f7815629059bd1b9ce2d8 Mon Sep 17 00:00:00 2001 From: MaximilianoTabacman Date: Tue, 9 Jan 2024 11:45:24 -0300 Subject: [PATCH] Separated stress tests into adding and querying --- .../RepositoryBasedTest.class.st | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/source/Sagan-Core-Tests/RepositoryBasedTest.class.st b/source/Sagan-Core-Tests/RepositoryBasedTest.class.st index a2889f6..eac7392 100644 --- a/source/Sagan-Core-Tests/RepositoryBasedTest.class.st +++ b/source/Sagan-Core-Tests/RepositoryBasedTest.class.st @@ -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 [ @@ -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 [