@@ -36,14 +36,26 @@ private string PathFor(string sampleFile)
36
36
return Path . Combine ( SampleDataPath , sampleFile ) ;
37
37
}
38
38
39
+ [ Fact ]
40
+ public void Can_Deserialize_Into_Struct ( )
41
+ {
42
+ const string content = "<root><one>oneOneOne</one><two>twoTwoTwo</two><three>3</three></root>" ;
43
+ var xml = new XmlDeserializer ( ) ;
44
+ var output = xml . Deserialize < SimpleStruct > ( new RestResponse { Content = content } ) ;
45
+
46
+ Assert . NotNull ( output ) ;
47
+ Assert . Equal ( "oneOneOne" , output . One ) ;
48
+ Assert . Equal ( "twoTwoTwo" , output . Two ) ;
49
+ Assert . Equal ( 3 , output . Three ) ;
50
+ }
39
51
[ Fact ]
40
52
public void Can_Deserialize_Lists_of_Simple_Types ( )
41
53
{
42
54
var xmlpath = PathFor ( "xmllists.xml" ) ;
43
55
var doc = XDocument . Load ( xmlpath ) ;
44
56
45
57
var xml = new XmlDeserializer ( ) ;
46
- var output = xml . Deserialize < SimpleTypesListSample > ( new RestResponse ( ) { Content = doc . ToString ( ) } ) ;
58
+ var output = xml . Deserialize < SimpleTypesListSample > ( new RestResponse { Content = doc . ToString ( ) } ) ;
47
59
48
60
Assert . NotEmpty ( output . Names ) ;
49
61
Assert . NotEmpty ( output . Numbers ) ;
@@ -216,7 +228,7 @@ public void Can_Deserialize_Elements_to_Nullable_Values()
216
228
{
217
229
var culture = CultureInfo . InvariantCulture ;
218
230
var doc = CreateXmlWithoutEmptyValues ( culture ) ;
219
- var xml = new XmlDeserializer ( ) { Culture = culture } ;
231
+ var xml = new XmlDeserializer { Culture = culture } ;
220
232
var output = xml . Deserialize < NullableValues > ( new RestResponse { Content = doc } ) ;
221
233
222
234
Assert . NotNull ( output . Id ) ;
0 commit comments