@@ -31,7 +31,7 @@ static T GetPayLoad<T>(string fileName)
31
31
[ Test ]
32
32
public void Can_Deserialize_4sq_Json_With_Root_Element_Specified ( )
33
33
{
34
- var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "4sq.txt " ) ) ;
34
+ var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "4sq.json " ) ) ;
35
35
var serializer = new JsonSerializer { RootElement = "response" } ;
36
36
var output = serializer . Deserialize < VenuesResponse > ( new RestResponse { Content = doc } ) ;
37
37
@@ -78,7 +78,7 @@ public void Can_Deserialize_Date_With_Milliseconds()
78
78
[ Test ]
79
79
public void Can_Deserialize_DateTime ( )
80
80
{
81
- var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.txt " ) ;
81
+ var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.json " ) ;
82
82
83
83
Assert . AreEqual (
84
84
new DateTime ( 2011 , 6 , 30 , 8 , 15 , 46 , 929 , DateTimeKind . Utc ) ,
@@ -108,7 +108,7 @@ public void Can_Deserialize_DateTime_With_DateTimeStyles()
108
108
[ Test ]
109
109
public void Can_Deserialize_DateTimeOffset ( )
110
110
{
111
- var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.txt " ) ;
111
+ var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.json " ) ;
112
112
113
113
Assert . AreEqual (
114
114
new DateTime ( 2011 , 6 , 30 , 8 , 15 , 46 , 929 , DateTimeKind . Utc ) . ToString ( "yyyy-MM-dd HH:mm:ss.fff" ) ,
@@ -130,7 +130,7 @@ public void Can_Deserialize_Decimal_With_Four_Zeros_After_Floating_Point()
130
130
[ Test ]
131
131
public void Can_Deserialize_Dictionary_of_Lists ( )
132
132
{
133
- var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsondictionary.txt " ) ) ;
133
+ var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsondictionary.json " ) ) ;
134
134
var serializer = new JsonSerializer { RootElement = "response" } ;
135
135
var output = serializer . Deserialize < EmployeeTracker > ( new RestResponse { Content = doc } ) ;
136
136
@@ -142,7 +142,7 @@ public void Can_Deserialize_Dictionary_of_Lists()
142
142
[ Test ]
143
143
public void Can_Deserialize_Dictionary_with_Null ( )
144
144
{
145
- var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsondictionary_null.txt " ) ) ;
145
+ var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsondictionary_null.json " ) ) ;
146
146
var serializer = new JsonSerializer { RootElement = "response" } ;
147
147
148
148
IDictionary < string , object > output =
@@ -156,7 +156,7 @@ public void Can_Deserialize_Dictionary_with_Null()
156
156
[ Test ]
157
157
public void Can_Deserialize_Dot_Field ( )
158
158
{
159
- var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "bearertoken.txt " ) ) ;
159
+ var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "bearertoken.json " ) ) ;
160
160
var response = new RestResponse { Content = data } ;
161
161
var serializer = new JsonSerializer ( ) ;
162
162
var output = serializer . Deserialize < BearerToken > ( response ) ;
@@ -227,7 +227,7 @@ public void Can_Deserialize_Exponential_Notation()
227
227
[ Test ]
228
228
public void Can_Deserialize_From_Root_Element ( )
229
229
{
230
- var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "sojson.txt " ) ) ;
230
+ var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "sojson.json " ) ) ;
231
231
var serializer = new JsonSerializer { RootElement = "User" } ;
232
232
var output = serializer . Deserialize < SoUser > ( new RestResponse { Content = doc } ) ;
233
233
@@ -253,7 +253,7 @@ public void Can_Deserialize_Generic_List_of_DateTime()
253
253
[ Test ]
254
254
public void Can_Deserialize_Generic_Members ( )
255
255
{
256
- var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "GenericWithList.txt " ) ) ;
256
+ var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "GenericWithList.json " ) ) ;
257
257
var serializer = new JsonSerializer ( ) ;
258
258
259
259
var output =
@@ -334,7 +334,7 @@ public void Can_Deserialize_Iso_Json_Dates()
334
334
[ Test ]
335
335
public void Can_Deserialize_Iso8601DateTimeLocal ( )
336
336
{
337
- var payload = GetPayLoad < Iso8601DateTimeTestStructure > ( "iso8601datetimes.txt " ) ;
337
+ var payload = GetPayLoad < Iso8601DateTimeTestStructure > ( "iso8601datetimes.json " ) ;
338
338
339
339
Assert . AreEqual (
340
340
new DateTime ( 2012 , 7 , 19 , 10 , 23 , 25 , DateTimeKind . Utc ) ,
@@ -345,7 +345,7 @@ public void Can_Deserialize_Iso8601DateTimeLocal()
345
345
[ Test ]
346
346
public void Can_Deserialize_Iso8601DateTimeWithOffset ( )
347
347
{
348
- var payload = GetPayLoad < Iso8601DateTimeTestStructure > ( "iso8601datetimes.txt " ) ;
348
+ var payload = GetPayLoad < Iso8601DateTimeTestStructure > ( "iso8601datetimes.json " ) ;
349
349
350
350
Assert . AreEqual (
351
351
new DateTime ( 2012 , 7 , 19 , 10 , 23 , 25 , 544 , DateTimeKind . Utc ) ,
@@ -356,7 +356,7 @@ public void Can_Deserialize_Iso8601DateTimeWithOffset()
356
356
[ Test ]
357
357
public void Can_Deserialize_Iso8601DateTimeZulu ( )
358
358
{
359
- var payload = GetPayLoad < Iso8601DateTimeTestStructure > ( "iso8601datetimes.txt " ) ;
359
+ var payload = GetPayLoad < Iso8601DateTimeTestStructure > ( "iso8601datetimes.json " ) ;
360
360
361
361
Assert . AreEqual (
362
362
new DateTime ( 2012 , 7 , 19 , 10 , 23 , 25 , 544 , DateTimeKind . Utc ) ,
@@ -379,7 +379,7 @@ public void Can_Deserialize_Json_Using_DeserializeAs_Attribute()
379
379
[ Test ]
380
380
public void Can_Deserialize_JsonNet_Dates ( )
381
381
{
382
- var person = GetPayLoad < PersonForJson > ( "person.json.txt " ) ;
382
+ var person = GetPayLoad < PersonForJson > ( "person.json" ) ;
383
383
384
384
Assert . AreEqual (
385
385
new DateTime ( 2011 , 6 , 30 , 8 , 15 , 46 , 929 , DateTimeKind . Utc ) ,
@@ -406,7 +406,7 @@ public void Can_Deserialize_List_of_Guid()
406
406
[ Test ]
407
407
public void Can_Deserialize_Lists_of_Simple_Types ( )
408
408
{
409
- var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonlists.txt " ) ) ;
409
+ var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonlists.json " ) ) ;
410
410
var serializer = new JsonSerializer ( ) ;
411
411
var output = serializer . Deserialize < JsonLists > ( new RestResponse { Content = doc } ) ;
412
412
@@ -449,7 +449,7 @@ public void Can_Deserialize_Names_With_Dashes_With_Default_Root_Alternative_Cult
449
449
[ Test ]
450
450
public void Can_Deserialize_Names_With_Underscore_Prefix ( )
451
451
{
452
- var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "underscore_prefix.txt " ) ) ;
452
+ var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "underscore_prefix.json " ) ) ;
453
453
var response = new RestResponse { Content = data } ;
454
454
var serializer = new JsonSerializer { RootElement = "User" } ;
455
455
var output = serializer . Deserialize < SoUser > ( response ) ;
@@ -506,15 +506,15 @@ public void Can_Deserialize_Null_Elements_to_Nullable_Values()
506
506
[ Test ]
507
507
public void Can_Deserialize_Nullable_DateTime_With_Null ( )
508
508
{
509
- var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.txt " ) ;
509
+ var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.json " ) ;
510
510
511
511
Assert . Null ( payload . NullableDateTimeWithNull ) ;
512
512
}
513
513
514
514
[ Test ]
515
515
public void Can_Deserialize_Nullable_DateTime_With_Value ( )
516
516
{
517
- var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.txt " ) ;
517
+ var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.json " ) ;
518
518
519
519
Assert . NotNull ( payload . NullableDateTimeWithValue ) ;
520
520
@@ -527,15 +527,15 @@ public void Can_Deserialize_Nullable_DateTime_With_Value()
527
527
[ Test ]
528
528
public void Can_Deserialize_Nullable_DateTimeOffset_With_Null ( )
529
529
{
530
- var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.txt " ) ;
530
+ var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.json " ) ;
531
531
532
532
Assert . Null ( payload . NullableDateTimeOffsetWithNull ) ;
533
533
}
534
534
535
535
[ Test ]
536
536
public void Can_Deserialize_Nullable_DateTimeOffset_With_Value ( )
537
537
{
538
- var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.txt " ) ;
538
+ var payload = GetPayLoad < DateTimeTestStructure > ( "datetimes.json " ) ;
539
539
540
540
Assert . NotNull ( payload . NullableDateTimeOffsetWithValue ) ;
541
541
@@ -548,7 +548,7 @@ public void Can_Deserialize_Nullable_DateTimeOffset_With_Value()
548
548
[ Test ]
549
549
public void Can_Deserialize_Object_Type_Property_With_Primitive_Vale ( )
550
550
{
551
- var payload = GetPayLoad < ObjectProperties > ( "objectproperty.txt " ) ;
551
+ var payload = GetPayLoad < ObjectProperties > ( "objectproperty.json " ) ;
552
552
553
553
Assert . AreEqual ( 42L , payload . ObjectProperty ) ;
554
554
}
@@ -579,7 +579,7 @@ public void Can_Deserialize_Quoted_Primitive()
579
579
[ Test ]
580
580
public void Can_Deserialize_Root_Json_Array_To_Inherited_List ( )
581
581
{
582
- var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonarray.txt " ) ) ;
582
+ var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonarray.json " ) ) ;
583
583
var response = new RestResponse { Content = data } ;
584
584
var serializer = new JsonSerializer ( ) ;
585
585
var output = serializer . Deserialize < StatusList > ( response ) ;
@@ -590,7 +590,7 @@ public void Can_Deserialize_Root_Json_Array_To_Inherited_List()
590
590
[ Test ]
591
591
public void Can_Deserialize_Root_Json_Array_To_List ( )
592
592
{
593
- var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonarray.txt " ) ) ;
593
+ var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonarray.json " ) ) ;
594
594
var response = new RestResponse { Content = data } ;
595
595
var serializer = new JsonSerializer ( ) ;
596
596
var output = serializer . Deserialize < List < status > > ( response ) ;
@@ -601,7 +601,7 @@ public void Can_Deserialize_Root_Json_Array_To_List()
601
601
[ Test ]
602
602
public void Can_Deserialize_Select_Tokens ( )
603
603
{
604
- var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonarray.txt " ) ) ;
604
+ var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonarray.json " ) ) ;
605
605
var response = new RestResponse { Content = data } ;
606
606
var serializer = new JsonSerializer ( ) ;
607
607
var output = serializer . Deserialize < StatusComplexList > ( response ) ;
@@ -654,7 +654,7 @@ public void Can_Deserialize_Simple_Generic_List_of_Simple_Types_With_Nulls()
654
654
[ Test ]
655
655
public void Can_Deserialize_TimeSpan ( )
656
656
{
657
- var payload = GetPayLoad < TimeSpanTestStructure > ( "timespans.txt " ) ;
657
+ var payload = GetPayLoad < TimeSpanTestStructure > ( "timespans.json " ) ;
658
658
659
659
Assert . AreEqual ( new TimeSpan ( 468006 ) , payload . Tick ) ;
660
660
Assert . AreEqual ( new TimeSpan ( 0 , 0 , 0 , 0 , 125 ) , payload . Millisecond ) ;
@@ -677,7 +677,7 @@ public void Can_Deserialize_TimeSpan()
677
677
[ Test ]
678
678
public void Can_Deserialize_To_Dictionary_Int_Object ( )
679
679
{
680
- var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsondictionary_KeysType.txt " ) ) ;
680
+ var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsondictionary_KeysType.json " ) ) ;
681
681
var serializer = new JsonSerializer ( ) ;
682
682
683
683
var output =
@@ -693,7 +693,7 @@ public void Can_Deserialize_To_Dictionary_Int_Object()
693
693
[ Test ]
694
694
public void Can_Deserialize_To_Dictionary_String_Object ( )
695
695
{
696
- var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsondictionary.txt " ) ) ;
696
+ var doc = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsondictionary.json " ) ) ;
697
697
var serializer = new JsonSerializer ( ) ;
698
698
699
699
var output =
@@ -755,7 +755,7 @@ public void Can_Deserialize_Unix_Json_Millisecond_Dates()
755
755
[ Test ]
756
756
public void Can_Deserialize_Various_Enum_Types ( )
757
757
{
758
- var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonenumtypes.txt " ) ) ;
758
+ var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonenumtypes.json " ) ) ;
759
759
var response = new RestResponse { Content = data } ;
760
760
var serializer = new JsonSerializer ( ) ;
761
761
var output = serializer . Deserialize < JsonEnumTypesTestStructure > ( response ) ;
@@ -773,7 +773,7 @@ public void Can_Deserialize_Various_Enum_Types()
773
773
[ Test ]
774
774
public void Can_Deserialize_Various_Enum_Values ( )
775
775
{
776
- var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonenums.txt " ) ) ;
776
+ var data = File . ReadAllText ( Path . Combine ( CurrentPath , "SampleData" , "jsonenums.json " ) ) ;
777
777
var response = new RestResponse { Content = data } ;
778
778
var serializer = new JsonSerializer ( ) ;
779
779
var output = serializer . Deserialize < JsonEnumsTestStructure > ( response ) ;
0 commit comments