Skip to content

Commit

Permalink
adds 6 tests for the resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianconcept committed Mar 2, 2024
1 parent d001311 commit 544063a
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions src/Mapless-Mongo-Tests/MaplessResolversTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,76 @@ MaplessResolversTest >> tearDown [
shutDown
]

{ #category : #tests }
MaplessResolversTest >> testCanRepresentArrayOfMaplessReferences [

self assert: (repository resolver
canRepresentArrayOfMaplessReferences: {
{
('_c' -> 'SampleUser').
('_id' -> '12') } asDictionary.
{
('_c' -> 'SamplePerson').
('_id' -> '123') } asDictionary }
in: repository)
]

{ #category : #tests }
MaplessResolversTest >> testCanRepresentSubMapless [

self assert: (repository resolver
canRepresentSubMapless: {
('_c' -> 'SamplePerson').
('_id' -> '123') } asDictionary
in: repository)
]

{ #category : #tests }
MaplessResolversTest >> testConditionForClass [

self
assert: (repository resolver conditionForClass: SamplePerson)
equals: { ('_c' -> 'SamplePerson') } asDictionary
]

{ #category : #tests }
MaplessResolversTest >> testMaplessAsStorable [

| saved |
saved := SamplePerson new.
repository save: saved.

self
assert:
(repository resolver maplessAsStorable: saved in: repository)
asDictionary
equals: {
('_c' -> 'SamplePerson').
('_id' -> saved id) } asDictionary
]

{ #category : #tests }
MaplessResolversTest >> testMaplessClass [

self
assert: (repository resolver
maplessClassFor: { ('_c' -> 'SamplePerson') } asDictionary
in: repository)
equals: SamplePerson
]

{ #category : #tests }
MaplessResolversTest >> testMaplessClassNameFor [

self
assert: (repository resolver
maplessClassNameFor: {
('_c' -> 'SamplePerson').
('_id' -> '123') } asDictionary
in: repository)
equals: 'SamplePerson'
]

{ #category : #tests }
MaplessResolversTest >> testMaplessCustomCollectionNameResolver [

Expand Down

0 comments on commit 544063a

Please sign in to comment.