@@ -225,10 +225,9 @@ public void Can_Deserialize_Empty_Elements_to_Nullable_Values()
225225 [ Fact ]
226226 public void Can_Deserialize_Elements_to_Nullable_Values ( )
227227 {
228- var culture = CultureInfo . InvariantCulture ;
229- var doc = CreateXmlWithoutEmptyValues ( culture ) ;
230-
231- var xml = new XmlDeserializer ( ) { Culture = culture } ;
228+ var culture = CultureInfo . InvariantCulture ;
229+ var doc = CreateXmlWithoutEmptyValues ( culture ) ;
230+ var xml = new XmlDeserializer ( ) { Culture = culture } ;
232231 var output = xml . Deserialize < NullableValues > ( new RestResponse { Content = doc } ) ;
233232
234233 Assert . NotNull ( output . Id ) ;
@@ -243,24 +242,24 @@ public void Can_Deserialize_Elements_to_Nullable_Values()
243242 [ Fact ]
244243 public void Can_Deserialize_Custom_Formatted_Date ( )
245244 {
246- var culture = CultureInfo . InvariantCulture ;
245+ var culture = CultureInfo . InvariantCulture ;
247246 var format = "dd yyyy MMM, hh:mm ss tt zzz" ;
248247 var date = new DateTime ( 2010 , 2 , 8 , 11 , 11 , 11 ) ;
249248
250249 var doc = new XDocument ( ) ;
251250
252251 var root = new XElement ( "Person" ) ;
253- root . Add ( new XElement ( "StartDate" , date . ToString ( format , culture ) ) ) ;
252+ root . Add ( new XElement ( "StartDate" , date . ToString ( format , culture ) ) ) ;
254253
255254 doc . Add ( root ) ;
256255
257- var xml = new XmlDeserializer
258- {
259- DateFormat = format ,
260- Culture = culture
261- } ;
256+ var xml = new XmlDeserializer
257+ {
258+ DateFormat = format ,
259+ Culture = culture
260+ } ;
262261
263- var response = new RestResponse { Content = doc . ToString ( ) } ;
262+ var response = new RestResponse { Content = doc . ToString ( ) } ;
264263 var output = xml . Deserialize < PersonForXml > ( response ) ;
265264
266265 Assert . Equal ( date , output . StartDate ) ;
@@ -515,31 +514,31 @@ public void Can_Deserialize_Boolean_From_String()
515514 Assert . True ( output . Value ) ;
516515 }
517516
518- [ Fact ]
519- public void Can_Deserialize_Empty_Elements_With_Attributes_to_Nullable_Values ( )
520- {
521- var doc = CreateXmlWithAttributesAndNullValues ( ) ;
517+ [ Fact ]
518+ public void Can_Deserialize_Empty_Elements_With_Attributes_to_Nullable_Values ( )
519+ {
520+ var doc = CreateXmlWithAttributesAndNullValues ( ) ;
522521
523- var xml = new XmlDeserializer ( ) ;
524- var output = xml . Deserialize < NullableValues > ( new RestResponse { Content = doc } ) ;
522+ var xml = new XmlDeserializer ( ) ;
523+ var output = xml . Deserialize < NullableValues > ( new RestResponse { Content = doc } ) ;
525524
526- Assert . Null ( output . Id ) ;
527- Assert . Null ( output . StartDate ) ;
528- Assert . Null ( output . UniqueId ) ;
529- }
525+ Assert . Null ( output . Id ) ;
526+ Assert . Null ( output . StartDate ) ;
527+ Assert . Null ( output . UniqueId ) ;
528+ }
530529
531- [ Fact ]
532- public void Can_Deserialize_Mixture_Of_Empty_Elements_With_Attributes_And_Populated_Elements ( )
533- {
534- var doc = CreateXmlWithAttributesAndNullValuesAndPopulatedValues ( ) ;
530+ [ Fact ]
531+ public void Can_Deserialize_Mixture_Of_Empty_Elements_With_Attributes_And_Populated_Elements ( )
532+ {
533+ var doc = CreateXmlWithAttributesAndNullValuesAndPopulatedValues ( ) ;
535534
536- var xml = new XmlDeserializer ( ) ;
537- var output = xml . Deserialize < NullableValues > ( new RestResponse { Content = doc } ) ;
535+ var xml = new XmlDeserializer ( ) ;
536+ var output = xml . Deserialize < NullableValues > ( new RestResponse { Content = doc } ) ;
538537
539- Assert . Null ( output . Id ) ;
540- Assert . Null ( output . StartDate ) ;
541- Assert . Equal ( new Guid ( GuidString ) , output . UniqueId ) ;
542- }
538+ Assert . Null ( output . Id ) ;
539+ Assert . Null ( output . StartDate ) ;
540+ Assert . Equal ( new Guid ( GuidString ) , output . UniqueId ) ;
541+ }
543542
544543 private static string CreateUnderscoresXml ( )
545544 {
@@ -757,9 +756,9 @@ private static string CreateXmlWithoutEmptyValues(CultureInfo culture)
757756 var root = new XElement ( "NullableValues" ) ;
758757
759758 root . Add ( new XElement ( "Id" , 123 ) ,
760- new XElement ( "StartDate" , new DateTime ( 2010 , 2 , 21 , 9 , 35 , 00 ) . ToString ( culture ) ) ,
761- new XElement ( "UniqueId" , new Guid ( GuidString ) )
762- ) ;
759+ new XElement ( "StartDate" , new DateTime ( 2010 , 2 , 21 , 9 , 35 , 00 ) . ToString ( culture ) ) ,
760+ new XElement ( "UniqueId" , new Guid ( GuidString ) )
761+ ) ;
763762
764763 doc . Add ( root ) ;
765764
@@ -788,38 +787,38 @@ private static string CreateXmlWithEmptyInlineList()
788787 return doc . ToString ( ) ;
789788 }
790789
791- private static string CreateXmlWithAttributesAndNullValues ( )
792- {
793- var doc = new XDocument ( ) ;
794- var root = new XElement ( "NullableValues" ) ;
790+ private static string CreateXmlWithAttributesAndNullValues ( )
791+ {
792+ var doc = new XDocument ( ) ;
793+ var root = new XElement ( "NullableValues" ) ;
795794
796- var idElement = new XElement ( "Id" , null ) ;
797- idElement . SetAttributeValue ( "SomeAttribute" , "SomeAttribute_Value" ) ;
798- root . Add ( idElement ,
799- new XElement ( "StartDate" , null ) ,
800- new XElement ( "UniqueId" , null )
801- ) ;
795+ var idElement = new XElement ( "Id" , null ) ;
796+ idElement . SetAttributeValue ( "SomeAttribute" , "SomeAttribute_Value" ) ;
797+ root . Add ( idElement ,
798+ new XElement ( "StartDate" , null ) ,
799+ new XElement ( "UniqueId" , null )
800+ ) ;
802801
803- doc . Add ( root ) ;
802+ doc . Add ( root ) ;
804803
805- return doc . ToString ( ) ;
806- }
804+ return doc . ToString ( ) ;
805+ }
807806
808- private static string CreateXmlWithAttributesAndNullValuesAndPopulatedValues ( )
809- {
810- var doc = new XDocument ( ) ;
811- var root = new XElement ( "NullableValues" ) ;
807+ private static string CreateXmlWithAttributesAndNullValuesAndPopulatedValues ( )
808+ {
809+ var doc = new XDocument ( ) ;
810+ var root = new XElement ( "NullableValues" ) ;
812811
813- var idElement = new XElement ( "Id" , null ) ;
814- idElement . SetAttributeValue ( "SomeAttribute" , "SomeAttribute_Value" ) ;
815- root . Add ( idElement ,
816- new XElement ( "StartDate" , null ) ,
817- new XElement ( "UniqueId" , new Guid ( GuidString ) )
818- ) ;
812+ var idElement = new XElement ( "Id" , null ) ;
813+ idElement . SetAttributeValue ( "SomeAttribute" , "SomeAttribute_Value" ) ;
814+ root . Add ( idElement ,
815+ new XElement ( "StartDate" , null ) ,
816+ new XElement ( "UniqueId" , new Guid ( GuidString ) )
817+ ) ;
819818
820- doc . Add ( root ) ;
819+ doc . Add ( root ) ;
821820
822- return doc . ToString ( ) ;
823- }
821+ return doc . ToString ( ) ;
822+ }
824823 }
825824}
0 commit comments