Skip to content

Commit

Permalink
Add shouldSerializedChildren tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
labordep committed Mar 8, 2024
1 parent 49f8964 commit 8e024c9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"
This BlELement is a used for testing the no serialization of children.
"
Class {
#name : #BlTestShouldNotSerializedChildrenElement,
#superclass : #BlElement,
#category : #'Bloc-Serialization-Tests-Core'
}

{ #category : #asserting }
BlTestShouldNotSerializedChildrenElement >> shouldSerializedChildren [

^ false
]
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,40 @@ BlocSerializationChildrenTests >> testNoChildren [
on: [ :element | self assert: element children size equals: 0.
self assert: element parent equals: nil ]
]

{ #category : #tests }
BlocSerializationChildrenTests >> testShouldNotSerializedChildrenBasic1 [

| origin e1 e2 e3 element |
origin := BlTestShouldNotSerializedChildrenElement new.
e1 := BlElement new.
e2 := BlElement new.
e3 := BlElement new.

origin addChildren: {
e1.
e2.
e3 }.

element := origin serializeThenMaterialize.
self assert: element parent equals: nil.
self assert: element children size equals: 0.
]

{ #category : #tests }
BlocSerializationChildrenTests >> testShouldNotSerializedChildrenBasic2 [

| origin e1 e2 e3 element |
origin := BlTestShouldNotSerializedChildrenElement new.
e1 := BlElement new.
e2 := BlElement new.
e3 := BlElement new.

origin addChild: e1.
e1 addChild: e2.
e2 addChild: e3.

element := origin serializeThenMaterialize.
self assert: element parent equals: nil.
self assert: element children size equals: 0.
]

0 comments on commit 8e024c9

Please sign in to comment.