@@ -815,14 +815,13 @@ public void TestMultipleKeyGetAsync()
815
815
}
816
816
}
817
817
818
- public void TestDeleteByIdAsync ( )
818
+ public async void TestDeleteByIdAsync ( )
819
819
{
820
820
using ( var connection = GetOpenConnection ( ) )
821
821
{
822
822
var id = connection . Insert ( new User { Name = "UserAsyncDelete" , Age = 10 } ) ;
823
- connection . DeleteAsync < User > ( id ) ;
823
+ await connection . DeleteAsync < User > ( id ) ;
824
824
//tiny wait to let the delete happen
825
- System . Threading . Thread . Sleep ( 300 ) ;
826
825
connection . Get < User > ( id ) . IsNull ( ) ;
827
826
}
828
827
}
@@ -1396,6 +1395,41 @@ public void TestUpdateUsingInterface()
1396
1395
}
1397
1396
}
1398
1397
1398
+ public async void TestUpdateAsyncUsingInterface ( )
1399
+ {
1400
+ using ( var connection = GetOpenConnection ( ) )
1401
+ using ( var transaction = connection . BeginTransaction ( ) )
1402
+ {
1403
+ INameColumn newUser = new UserWithIName
1404
+ {
1405
+ Age = 40 ,
1406
+ Name = "Jonathan Larouche" ,
1407
+ ScheduledDayOff = DayOfWeek . Sunday ,
1408
+ CreatedDate = new DateTime ( 2000 , 1 , 1 )
1409
+ } ;
1410
+
1411
+ ( ( UserWithIName ) newUser ) . Id = connection . Insert ( newUser , transaction ) . Value ;
1412
+ ( ( UserWithIName ) newUser ) . Age = 41 ;
1413
+ await connection . UpdateAsync ( newUser , transaction ) ;
1414
+
1415
+ INameColumn newCity = new CityWithIName
1416
+ {
1417
+ Name = "Montreal" ,
1418
+ Population = 5675
1419
+ } ;
1420
+
1421
+ connection . Insert < string , INameColumn > ( newCity , transaction ) ;
1422
+ ( ( CityWithIName ) newCity ) . Population = 6000 ;
1423
+ await connection . UpdateAsync ( newCity , transaction ) ;
1424
+
1425
+ var user = connection . GetList < UserWithIName > ( new { Name = "Jonathan Larouche" } , transaction ) . FirstOrDefault ( ) ;
1426
+ user . Age . IsEqualTo ( 41 ) ;
1427
+ var city = connection . GetList < CityWithIName > ( new { Name = "Montreal" } , transaction ) . FirstOrDefault ( ) ;
1428
+ city . Population . IsEqualTo ( 6000 ) ;
1429
+
1430
+ }
1431
+ }
1432
+
1399
1433
//ignore attribute tests
1400
1434
//i cheated here and stuffed all of these in one test
1401
1435
//didn't implement in postgres or mysql tests yet
0 commit comments