From 476a1d7acc722389c722c2ab69aaf31763fcbb1e Mon Sep 17 00:00:00 2001 From: MaximilianoTabacman Date: Tue, 30 Jan 2024 16:13:15 -0300 Subject: [PATCH] Added coverage for in memory repository module --- ...emoryRepositoryProviderModuleTest.class.st | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 source/Sagan-Kepler-Tests/InMemoryRepositoryProviderModuleTest.class.st diff --git a/source/Sagan-Kepler-Tests/InMemoryRepositoryProviderModuleTest.class.st b/source/Sagan-Kepler-Tests/InMemoryRepositoryProviderModuleTest.class.st new file mode 100644 index 0000000..a7b6b05 --- /dev/null +++ b/source/Sagan-Kepler-Tests/InMemoryRepositoryProviderModuleTest.class.st @@ -0,0 +1,37 @@ +Class { + #name : 'InMemoryRepositoryProviderModuleTest', + #superclass : 'TestCase', + #category : 'Sagan-Kepler-Tests', + #package : 'Sagan-Kepler-Tests' +} + +{ #category : 'private - accessing' } +InMemoryRepositoryProviderModuleTest >> repositoryIn: aUserStory [ + + ^ aUserStory rootSystem >> #RepositoryProviderSystem + createRepositoryFor: #mainDB + storingObjectsOfType: CelestialBody + checkingConflictsAccordingTo: DoNotCheckForConflictsStrategy new +] + +{ #category : 'tests' } +InMemoryRepositoryProviderModuleTest >> testInstallation [ + + | userStory celestialBodies | + + userStory := self userStoryTest. + userStory setUp. + celestialBodies := self repositoryIn: userStory. + + self assert: celestialBodies findAll isEmpty +] + +{ #category : 'private - accessing' } +InMemoryRepositoryProviderModuleTest >> userStoryTest [ + + ^ PluggableUserStoryTest requiring: [ :test | + test registerSubsystem: ( RepositoryProviderSystem new + register: InMemoryRepositoryProvider new as: #mainDB; + yourself ) + ] +]