Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
Class {
#name : #BlElementSerializationTests,
#superclass : #TestCase,
#category : #'Bloc-Serialization-Tests-Extensions'
#name : 'BlElementSerializationTests',
#superclass : 'TestCase',
#category : 'Bloc-Serialization-Tests-Extensions',
#package : 'Bloc-Serialization-Tests',
#tag : 'Extensions'
}

{ #category : #tests }
{ #category : 'tests' }
BlElementSerializationTests >> testSerialize [

| string |
string := BlElement new serialize.
self assert: string isString
]

{ #category : #tests }
{ #category : 'tests' }
BlElementSerializationTests >> testSerializeThenMaterialize [

| element newElement |
Expand Down
24 changes: 13 additions & 11 deletions src/Bloc-Serialization-Tests/BlSerializerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
A BlSerializerTest is a test class for testing the behavior of BlSerializer
"
Class {
#name : #BlSerializerTest,
#superclass : #TestCase,
#category : #'Bloc-Serialization-Tests-Core'
#name : 'BlSerializerTest',
#superclass : 'TestCase',
#category : 'Bloc-Serialization-Tests-Core',
#package : 'Bloc-Serialization-Tests',
#tag : 'Core'
}

{ #category : #tests }
{ #category : 'tests' }
BlSerializerTest >> testMaterializeEmptyString [

| error blElement |
Expand All @@ -19,7 +21,7 @@ BlSerializerTest >> testMaterializeEmptyString [
self assert: (error isKindOf: BlocMaterializationError)
]

{ #category : #tests }
{ #category : 'tests' }
BlSerializerTest >> testMaterializeNilString [

| blElement error |
Expand All @@ -31,7 +33,7 @@ BlSerializerTest >> testMaterializeNilString [
self assert: (error isKindOf: BlocMaterializationError)
]

{ #category : #tests }
{ #category : 'tests' }
BlSerializerTest >> testMaterializeNotSerializedString [

| blElement error |
Expand All @@ -43,15 +45,15 @@ BlSerializerTest >> testMaterializeNotSerializedString [
self assert: (error isKindOf: BlocMaterializationError)
]

{ #category : #tests }
{ #category : 'tests' }
BlSerializerTest >> testSerialize [

| string |
string := BlSerializer serialize: BlElement new.
self assert: string isString
]

{ #category : #tests }
{ #category : 'tests' }
BlSerializerTest >> testSerializeBlElementCollection [
| error result oc oc2 |

Expand All @@ -71,7 +73,7 @@ BlSerializerTest >> testSerializeBlElementCollection [
self assert: (oc2 allSatisfy: [ :e | e class = BlElement ]).
]

{ #category : #tests }
{ #category : 'tests' }
BlSerializerTest >> testSerializeNilObject [

| error blElement |
Expand All @@ -83,7 +85,7 @@ BlSerializerTest >> testSerializeNilObject [
self assert: (error isKindOf: BlocSerializationError)
]

{ #category : #tests }
{ #category : 'tests' }
BlSerializerTest >> testSerializeNoBlElement [
| error result |

Expand All @@ -108,7 +110,7 @@ BlSerializerTest >> testSerializeNoBlElement [
self assert: (error isKindOf: BlocSerializationError). "this test is ok because of a empty string is an empty collection"
]

{ #category : #tests }
{ #category : 'tests' }
BlSerializerTest >> testSerializeThenMaterialize [

| string blElement |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #BlocSerializationBackgroundTests,
#superclass : #BlocSerializationTests,
#category : #'Bloc-Serialization-Tests-Core'
#name : 'BlocSerializationBackgroundTests',
#superclass : 'BlocSerializationTests',
#category : 'Bloc-Serialization-Tests-Core',
#package : 'Bloc-Serialization-Tests',
#tag : 'Core'
}

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBackgroundTests >> testColor [

| origin |
Expand All @@ -17,7 +19,7 @@ BlocSerializationBackgroundTests >> testColor [
equals: (Color red alpha: 0.8) ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBackgroundTests >> testImageBackground1 [

| origin |
Expand All @@ -32,7 +34,7 @@ BlocSerializationBackgroundTests >> testImageBackground1 [
equals: PolymorphSystemSettings pharoLogoForm bits ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBackgroundTests >> testImageBackground2 [

| origin |
Expand All @@ -48,7 +50,7 @@ BlocSerializationBackgroundTests >> testImageBackground2 [
self assert: element background opacity equals: 0.5 ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBackgroundTests >> testLinearGradient1 [

| origin |
Expand All @@ -69,7 +71,7 @@ BlocSerializationBackgroundTests >> testLinearGradient1 [
equals: 1 -> Color blue ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBackgroundTests >> testLinearGradient2 [

| origin |
Expand All @@ -90,7 +92,7 @@ BlocSerializationBackgroundTests >> testLinearGradient2 [
equals: 1 -> Color blue ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBackgroundTests >> testLinearGradient3 [

| origin |
Expand All @@ -112,7 +114,7 @@ BlocSerializationBackgroundTests >> testLinearGradient3 [
equals: 1 -> Color blue ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBackgroundTests >> testLinearGradient4 [

| origin |
Expand Down Expand Up @@ -145,7 +147,7 @@ BlocSerializationBackgroundTests >> testLinearGradient4 [
equals: 1 -> Color black ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBackgroundTests >> testPaintTransparent [

| origin |
Expand All @@ -157,7 +159,7 @@ BlocSerializationBackgroundTests >> testPaintTransparent [
self assert: element background isTransparent equals: true ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBackgroundTests >> testRadailGradient1 [

| origin |
Expand All @@ -180,7 +182,7 @@ BlocSerializationBackgroundTests >> testRadailGradient1 [
equals: 1 -> Color blue ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBackgroundTests >> testRadialGradient2 [

| origin |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #BlocSerializationBlRopedTextTests,
#superclass : #BlocSerializationTests,
#category : #'Bloc-Serialization-Tests-Core'
#name : 'BlocSerializationBlRopedTextTests',
#superclass : 'BlocSerializationTests',
#category : 'Bloc-Serialization-Tests-Core',
#package : 'Bloc-Serialization-Tests',
#tag : 'Core'
}

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBlRopedTextTests >> testMultiplesAttributes [

| origin |
Expand All @@ -23,7 +25,7 @@ BlocSerializationBlRopedTextTests >> testMultiplesAttributes [
att class = BlTextForegroundAttribute and: [ att paint = Color red ] ]) ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBlRopedTextTests >> testNoAttributes [

| origin |
Expand All @@ -34,7 +36,7 @@ BlocSerializationBlRopedTextTests >> testNoAttributes [
on: [ :element | self assert: origin text rope asString equals: 'test' ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBlRopedTextTests >> testOneAttribute [

| origin |
Expand Down
32 changes: 17 additions & 15 deletions src/Bloc-Serialization-Tests/BlocSerializationBorderTests.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #BlocSerializationBorderTests,
#superclass : #BlocSerializationTests,
#category : #'Bloc-Serialization-Tests-Core'
#name : 'BlocSerializationBorderTests',
#superclass : 'BlocSerializationTests',
#category : 'Bloc-Serialization-Tests-Core',
#package : 'Bloc-Serialization-Tests',
#tag : 'Core'
}

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorder [

| builder origin |
Expand All @@ -23,7 +25,7 @@ BlocSerializationBorderTests >> testBorder [
equals: (Color red alpha: 0.8) ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorderCapButt [

| builder origin |
Expand All @@ -46,7 +48,7 @@ BlocSerializationBorderTests >> testBorderCapButt [
equals: BlStrokeLineButtCap ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorderCapRound [

| builder origin |
Expand All @@ -69,7 +71,7 @@ BlocSerializationBorderTests >> testBorderCapRound [
equals: BlStrokeLineRoundCap ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorderCapSquare [

| builder origin |
Expand All @@ -92,7 +94,7 @@ BlocSerializationBorderTests >> testBorderCapSquare [
equals: BlStrokeLineSquareCap ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorderCustomDashArray [

| builder origin |
Expand All @@ -113,7 +115,7 @@ BlocSerializationBorderTests >> testBorderCustomDashArray [
self assert: element border style dashArray equals: #( 2.6 4.2 ) ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorderCustomDashOffset [

| builder origin |
Expand All @@ -136,7 +138,7 @@ BlocSerializationBorderTests >> testBorderCustomDashOffset [
self assert: element border style dashOffset equals: 3.5 ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorderDashed [

| builder origin |
Expand All @@ -158,7 +160,7 @@ BlocSerializationBorderTests >> testBorderDashed [
self assert: element border style dashOffset equals: 0 ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorderDashedSmall [

| builder origin |
Expand All @@ -180,7 +182,7 @@ BlocSerializationBorderTests >> testBorderDashedSmall [
self assert: element border style dashOffset equals: 0 ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorderJoinBevel [

| builder origin |
Expand All @@ -203,7 +205,7 @@ BlocSerializationBorderTests >> testBorderJoinBevel [
equals: BlStrokeLineBevelJoin ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorderJoinMiter [

| builder origin |
Expand All @@ -226,7 +228,7 @@ BlocSerializationBorderTests >> testBorderJoinMiter [
equals: BlStrokeLineMiterJoin ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorderJoinRound [

| builder origin |
Expand All @@ -250,7 +252,7 @@ BlocSerializationBorderTests >> testBorderJoinRound [
equals: BlStrokeLineRoundJoin ]
]

{ #category : #tests }
{ #category : 'tests' }
BlocSerializationBorderTests >> testBorderSolid [

| builder origin |
Expand Down
Loading