@@ -12,6 +12,8 @@ import ObjectMapper
12
12
13
13
class BasicTypesTests : XCTestCase {
14
14
15
+ let mapper = Mapper < BasicTypes > ( )
16
+
15
17
override func setUp( ) {
16
18
super. setUp ( )
17
19
// Put setup code here. This method is called before the invocation of each test method in the class.
@@ -32,7 +34,7 @@ class BasicTypesTests: XCTestCase {
32
34
object. boolOptional = value
33
35
34
36
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
35
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
37
+ var mappedObject = mapper . map ( string: JSON)
36
38
37
39
if let mappedObject = mappedObject {
38
40
@@ -50,7 +52,7 @@ class BasicTypesTests: XCTestCase {
50
52
object. intOptional = value
51
53
52
54
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
53
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
55
+ var mappedObject = mapper . map ( string: JSON)
54
56
55
57
if let mappedObject = mappedObject {
56
58
@@ -68,7 +70,7 @@ class BasicTypesTests: XCTestCase {
68
70
object. doubleOptional = value
69
71
70
72
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
71
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
73
+ var mappedObject = mapper . map ( string: JSON)
72
74
73
75
if let mappedObject = mappedObject {
74
76
@@ -86,7 +88,7 @@ class BasicTypesTests: XCTestCase {
86
88
object. floatOptional = value
87
89
88
90
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
89
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
91
+ var mappedObject = mapper . map ( string: JSON)
90
92
91
93
if let mappedObject = mappedObject {
92
94
@@ -104,7 +106,7 @@ class BasicTypesTests: XCTestCase {
104
106
object. stringOptional = value
105
107
106
108
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
107
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
109
+ var mappedObject = mapper . map ( string: JSON)
108
110
109
111
if let mappedObject = mappedObject {
110
112
@@ -124,7 +126,7 @@ class BasicTypesTests: XCTestCase {
124
126
object. arrayBoolOptional = [ value]
125
127
126
128
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
127
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
129
+ var mappedObject = mapper . map ( string: JSON)
128
130
129
131
if let mappedObject = mappedObject {
130
132
var firstObject = mappedObject. arrayBool [ 0 ]
@@ -142,7 +144,7 @@ class BasicTypesTests: XCTestCase {
142
144
object. arrayIntOptional = [ value]
143
145
144
146
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
145
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
147
+ var mappedObject = mapper . map ( string: JSON)
146
148
147
149
if let mappedObject = mappedObject {
148
150
var firstObject = mappedObject. arrayInt [ 0 ]
@@ -160,7 +162,7 @@ class BasicTypesTests: XCTestCase {
160
162
object. arrayDoubleOptional = [ value]
161
163
162
164
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
163
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
165
+ var mappedObject = mapper . map ( string: JSON)
164
166
165
167
if let mappedObject = mappedObject {
166
168
var firstObject = mappedObject. arrayDouble [ 0 ]
@@ -178,7 +180,7 @@ class BasicTypesTests: XCTestCase {
178
180
object. arrayFloatOptional = [ value]
179
181
180
182
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
181
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
183
+ var mappedObject = mapper . map ( string: JSON)
182
184
183
185
if let mappedObject = mappedObject {
184
186
var firstObject = mappedObject. arrayFloat [ 0 ]
@@ -196,7 +198,7 @@ class BasicTypesTests: XCTestCase {
196
198
object. arrayStringOptional = [ value]
197
199
198
200
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
199
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
201
+ var mappedObject = mapper . map ( string: JSON)
200
202
201
203
if let mappedObject = mappedObject {
202
204
var firstObject = mappedObject. arrayString [ 0 ]
@@ -217,7 +219,7 @@ class BasicTypesTests: XCTestCase {
217
219
object. dictBoolOptional = [ key: value]
218
220
219
221
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
220
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
222
+ var mappedObject = mapper . map ( string: JSON)
221
223
222
224
if let mappedObject = mappedObject {
223
225
if let val = mappedObject. dictBoolOptional ? [ key] {
@@ -237,7 +239,7 @@ class BasicTypesTests: XCTestCase {
237
239
object. dictIntOptional = [ key: value]
238
240
239
241
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
240
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
242
+ var mappedObject = mapper . map ( string: JSON)
241
243
242
244
if let mappedObject = mappedObject {
243
245
if let val = mappedObject. dictIntOptional ? [ key] {
@@ -257,7 +259,7 @@ class BasicTypesTests: XCTestCase {
257
259
object. dictDoubleOptional = [ key: value]
258
260
259
261
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
260
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
262
+ var mappedObject = mapper . map ( string: JSON)
261
263
262
264
if let mappedObject = mappedObject {
263
265
if let val = mappedObject. dictDoubleOptional ? [ key] {
@@ -277,7 +279,7 @@ class BasicTypesTests: XCTestCase {
277
279
object. dictFloatOptional = [ key: value]
278
280
279
281
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
280
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
282
+ var mappedObject = mapper . map ( string: JSON)
281
283
282
284
if let mappedObject = mappedObject {
283
285
if let val = mappedObject. dictFloatOptional ? [ key] {
@@ -297,7 +299,7 @@ class BasicTypesTests: XCTestCase {
297
299
object. dictStringOptional = [ key: value]
298
300
299
301
let JSON = Mapper ( ) . toJSONString ( object, prettyPrint: true )
300
- var mappedObject = Mapper < BasicTypes > ( ) . map ( string: JSON)
302
+ var mappedObject = mapper . map ( string: JSON)
301
303
302
304
if let mappedObject = mappedObject {
303
305
if let val = mappedObject. dictStringOptional ? [ key] {
0 commit comments