@@ -85,7 +85,7 @@ public void Can_serialize_Enum()
85
85
expected . Add ( root ) ;
86
86
87
87
Assert . Equal ( expected . ToString ( ) , doc . ToString ( ) ) ;
88
- }
88
+ }
89
89
90
90
[ Fact ]
91
91
public void Can_serialize_simple_POCO_With_DateFormat_Specified ( ) {
@@ -157,34 +157,34 @@ public void Can_serialize_simple_POCO_With_Attribute_Options_Defined() {
157
157
Assert . Equal ( expected . ToString ( ) , doc . ToString ( ) ) ;
158
158
}
159
159
160
- [ Fact ]
161
- public void Can_serialize_simple_POCO_With_Attribute_Options_Defined_And_Property_Containing_IList_Elements ( )
162
- {
163
- var poco = new WackyPerson
164
- {
165
- Name = "Foo" ,
166
- Age = 50 ,
167
- Price = 19.95m ,
168
- StartDate = new DateTime ( 2009 , 12 , 18 , 10 , 2 , 23 ) ,
169
- ContactData = new ContactData
170
- {
171
- EmailAddresses = new List < EmailAddress >
172
- {
173
- new EmailAddress
174
- {
175
-
176
- Location = "Work"
177
- }
178
- }
179
- }
180
- } ;
181
-
182
- var xml = new XmlSerializer ( ) ;
183
- var doc = xml . Serialize ( poco ) ;
184
- var expected = GetSimplePocoXDocWackyNamesWithIListProperty ( ) ;
185
-
186
- Assert . Equal ( expected . ToString ( ) , doc . ToString ( ) ) ;
187
- }
160
+ [ Fact ]
161
+ public void Can_serialize_simple_POCO_With_Attribute_Options_Defined_And_Property_Containing_IList_Elements ( )
162
+ {
163
+ var poco = new WackyPerson
164
+ {
165
+ Name = "Foo" ,
166
+ Age = 50 ,
167
+ Price = 19.95m ,
168
+ StartDate = new DateTime ( 2009 , 12 , 18 , 10 , 2 , 23 ) ,
169
+ ContactData = new ContactData
170
+ {
171
+ EmailAddresses = new List < EmailAddress >
172
+ {
173
+ new EmailAddress
174
+ {
175
+
176
+ Location = "Work"
177
+ }
178
+ }
179
+ }
180
+ } ;
181
+
182
+ var xml = new XmlSerializer ( ) ;
183
+ var doc = xml . Serialize ( poco ) ;
184
+ var expected = GetSimplePocoXDocWackyNamesWithIListProperty ( ) ;
185
+
186
+ Assert . Equal ( expected . ToString ( ) , doc . ToString ( ) ) ;
187
+ }
188
188
189
189
[ Fact ]
190
190
public void Can_serialize_a_list_which_is_the_root_element ( )
@@ -268,36 +268,36 @@ private class WackyPerson
268
268
[ SerializeAs ( Name = "start_date" , Attribute = true ) ]
269
269
public DateTime StartDate { get ; set ; }
270
270
271
- [ SerializeAs ( Name = "contact-data" ) ]
272
- public ContactData ContactData { get ; set ; }
271
+ [ SerializeAs ( Name = "contact-data" ) ]
272
+ public ContactData ContactData { get ; set ; }
273
273
}
274
274
275
275
[ SerializeAs ( Name = "People" ) ]
276
276
private class PersonList : List < Person >
277
277
{
278
-
278
+
279
279
}
280
280
281
- private class ContactData
282
- {
283
- public ContactData ( )
284
- {
285
- EmailAddresses = new List < EmailAddress > ( ) ;
286
- }
281
+ private class ContactData
282
+ {
283
+ public ContactData ( )
284
+ {
285
+ EmailAddresses = new List < EmailAddress > ( ) ;
286
+ }
287
287
288
- [ SerializeAs ( Name = "email-addresses" ) ]
289
- public List < EmailAddress > EmailAddresses { get ; set ; }
290
- }
288
+ [ SerializeAs ( Name = "email-addresses" ) ]
289
+ public List < EmailAddress > EmailAddresses { get ; set ; }
290
+ }
291
291
292
- [ SerializeAs ( Name = "email-address" ) ]
293
- private class EmailAddress
294
- {
295
- [ SerializeAs ( Name = "address" ) ]
296
- public string Address { get ; set ; }
292
+ [ SerializeAs ( Name = "email-address" ) ]
293
+ private class EmailAddress
294
+ {
295
+ [ SerializeAs ( Name = "address" ) ]
296
+ public string Address { get ; set ; }
297
297
298
- [ SerializeAs ( Name = "location" ) ]
299
- public string Location { get ; set ; }
300
- }
298
+ [ SerializeAs ( Name = "location" ) ]
299
+ public string Location { get ; set ; }
300
+ }
301
301
302
302
private XDocument GetSimplePocoXDoc ( )
303
303
{
@@ -376,25 +376,25 @@ private XDocument GetSimplePocoXDocWackyNames() {
376
376
return doc ;
377
377
}
378
378
379
- private XDocument GetSimplePocoXDocWackyNamesWithIListProperty ( )
380
- {
381
- var doc = new XDocument ( ) ;
382
- var root = new XElement ( "Person" ) ;
383
- root . Add ( new XAttribute ( "WackyName" , "Foo" ) ,
384
- new XElement ( "Age" , 50 ) ,
385
- new XAttribute ( "Price" , 19.95m ) ,
386
- new XAttribute ( "start_date" , new DateTime ( 2009 , 12 , 18 , 10 , 2 , 23 ) . ToString ( ) ) ,
387
- new XElement ( "contact-data" ,
388
- new XElement ( "email-addresses" ,
389
- new XElement ( "email-address" ,
390
- new XElement ( "address" , "[email protected] " ) ,
391
- new XElement ( "location" , "Work" )
392
- ) ) ) ) ;
393
-
394
- doc . Add ( root ) ;
395
-
396
- return doc ;
397
- }
379
+ private XDocument GetSimplePocoXDocWackyNamesWithIListProperty ( )
380
+ {
381
+ var doc = new XDocument ( ) ;
382
+ var root = new XElement ( "Person" ) ;
383
+ root . Add ( new XAttribute ( "WackyName" , "Foo" ) ,
384
+ new XElement ( "Age" , 50 ) ,
385
+ new XAttribute ( "Price" , 19.95m ) ,
386
+ new XAttribute ( "start_date" , new DateTime ( 2009 , 12 , 18 , 10 , 2 , 23 ) . ToString ( ) ) ,
387
+ new XElement ( "contact-data" ,
388
+ new XElement ( "email-addresses" ,
389
+ new XElement ( "email-address" ,
390
+ new XElement ( "address" , "[email protected] " ) ,
391
+ new XElement ( "location" , "Work" )
392
+ ) ) ) ) ;
393
+
394
+ doc . Add ( root ) ;
395
+
396
+ return doc ;
397
+ }
398
398
399
399
private XDocument GetSortedPropsXDoc ( ) {
400
400
var doc = new XDocument ( ) ;
0 commit comments