diff --git a/src/Bloc-Serialization-Tests/BlTestShouldNotSerializedChildrenElement.class.st b/src/Bloc-Serialization-Tests/BlTestShouldNotSerializedChildrenElement.class.st new file mode 100644 index 0000000..0433c6d --- /dev/null +++ b/src/Bloc-Serialization-Tests/BlTestShouldNotSerializedChildrenElement.class.st @@ -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 +] diff --git a/src/Bloc-Serialization-Tests/BlocSerializationChildrenTests.class.st b/src/Bloc-Serialization-Tests/BlocSerializationChildrenTests.class.st index 6a9d048..7f66176 100644 --- a/src/Bloc-Serialization-Tests/BlocSerializationChildrenTests.class.st +++ b/src/Bloc-Serialization-Tests/BlocSerializationChildrenTests.class.st @@ -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. +]