1- using System . Text ;
1+ using System . Text ;
22using CoreHelpers . WindowsAzure . Storage . Table . Tests . Contracts ;
33using CoreHelpers . WindowsAzure . Storage . Table . Tests . Extensions ;
44using CoreHelpers . WindowsAzure . Storage . Table . Tests . Models ;
@@ -34,7 +34,7 @@ public async Task VerifyImportFromJson()
3434 storageContext . AddAttributeMapper ( typeof ( DemoModel2 ) , tableName1 ) ;
3535
3636 // define the import data
37- var staticExportData = "[{\" RowKey\" :\" 2\" ,\" PartitionKey\" :\" 1\" ,\" Properties\" :[{\" PropertyName\" :\" P\" ,\" PropertyType\" :0,\" PropertyValue\" :\" 1\" },{\" PropertyName\" :\" R\" ,\" PropertyType\" :0,\" PropertyValue\" :\" 2\" }]}]" ;
37+ var staticExportData = "[{\" RowKey\" :\" 2\" ,\" PartitionKey\" :\" 1\" ,\" Properties\" :[{\" PropertyName\" :\" P\" ,\" PropertyType\" :0,\" PropertyValue\" :\" 1\" },{\" PropertyName\" :\" R\" ,\" PropertyType\" :0,\" PropertyValue\" :\" 2\" },{ \" PropertyName \" : \" CreatedAt \" , \" PropertyType \" :3, \" PropertyValue \" : \" 2023-01-30T22:58:40.5859427+00:00 \" } ]}]" ;
3838 var staticExportDataStream = new MemoryStream ( Encoding . UTF8 . GetBytes ( staticExportData ?? "" ) ) ;
3939
4040 // check if we have an empty tabel before import
@@ -53,7 +53,13 @@ public async Task VerifyImportFromJson()
5353 // get the data
5454 var data = await storageContext . Query < DemoModel2 > ( ) . Now ( ) ;
5555 Assert . Equal ( "1" , data . First ( ) . P ) ;
56- Assert . Equal ( "2" , data . First ( ) . R ) ;
56+ Assert . Equal ( "2" , data . First ( ) . R ) ;
57+
58+ var createdAtDate = DateTime . Parse ( "2023-01-30T22:58:40.5859427+00:00" ) ;
59+ var createdAtDateFromDataLoad = data . First ( ) . CreatedAt ;
60+
61+ Assert . Equal ( createdAtDate . ToUniversalTime ( ) , createdAtDateFromDataLoad ) ;
62+ Assert . Equal ( createdAtDate . ToUniversalTime ( ) , createdAtDateFromDataLoad . ToUniversalTime ( ) ) ;
5763
5864 // drop table
5965 await storageContext . DropTableAsync < DemoModel2 > ( ) ;
0 commit comments