forked from ObjectProfile/PythonBridge
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPBJsonSerializerTest.class.st
More file actions
64 lines (53 loc) · 1.54 KB
/
PBJsonSerializerTest.class.st
File metadata and controls
64 lines (53 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Class {
#name : #PBJsonSerializerTest,
#superclass : #TestCase,
#instVars : [
'serializer'
],
#category : #'PythonBridge-Platform'
}
{ #category : #testing }
PBJsonSerializerTest class >> isAbstract [
^ self == PBJsonSerializerTest
]
{ #category : #asserting }
PBJsonSerializerTest >> assertDeserialize: aString equals: anObject [
self assert: (serializer deserialize: aString) equals: anObject
]
{ #category : #asserting }
PBJsonSerializerTest >> assertSerialize: anObject equals: aString [
self assert: (serializer serialize: anObject) equals: aString
]
{ #category : #running }
PBJsonSerializerTest >> jsonSerializerClass [
self subclassResponsibility
]
{ #category : #running }
PBJsonSerializerTest >> setUp [
super setUp.
serializer := self jsonSerializerClass new
]
{ #category : #tests }
PBJsonSerializerTest >> testDeserializeArray [
self assertDeserialize: '[33,"foo"]' equals: #(33 'foo')
]
{ #category : #tests }
PBJsonSerializerTest >> testDeserializeNestedArrays [
self assertDeserialize: '[33,["foo","bar"]]' equals: #(33 #('foo' 'bar'))
]
{ #category : #tests }
PBJsonSerializerTest >> testDeserializeNil [
self assertDeserialize: 'null' equals: nil
]
{ #category : #tests }
PBJsonSerializerTest >> testSerializeArray [
self assertSerialize: #(33 'foo') equals: '[33,"foo"]'
]
{ #category : #tests }
PBJsonSerializerTest >> testSerializeNestedArrays [
self assertSerialize: #(33 #('foo' 'bar')) equals: '[33,["foo","bar"]]'
]
{ #category : #tests }
PBJsonSerializerTest >> testSerializeNil [
self assertSerialize: nil equals: 'null'
]