@@ -21,8 +21,8 @@ public void TestBadInsert(){
2121 IMongoCollection col = InitCollection ( "safeinsert" ) ;
2222 bool thrown = false ;
2323 try {
24- col . Insert ( new Document ( ) { { "x" , 1 } , { "y" , 2 } } , true ) ;
25- } catch ( MongoDuplicateKeyException mdk ) {
24+ col . Insert ( new Document { { "x" , 1 } , { "y" , 2 } } , true ) ;
25+ } catch ( MongoDuplicateKeyException ) {
2626 thrown = true ;
2727 } catch ( Exception e ) {
2828 Assert . Fail ( String . Format ( "Wrong exception thrown: {0}" , e . GetType ( ) . Name ) ) ;
@@ -35,10 +35,10 @@ public void TestBadUpdate(){
3535 IMongoCollection col = InitCollection ( "safeupdate" ) ;
3636 bool thrown = false ;
3737 try {
38- col . Update ( new Document ( ) { { "x" , 1 } } , new Document ( ) { { "x" , 2 } } , true ) ;
38+ col . Update ( new Document { { "x" , 1 } } , new Document { { "x" , 2 } } , true ) ;
3939 } catch ( MongoDuplicateKeyUpdateException ) {
4040 thrown = true ;
41- } catch ( MongoDuplicateKeyException mdk ) {
41+ } catch ( MongoDuplicateKeyException ) {
4242 Assert . Fail ( "MongoDuplicateKeyException thown instead of MongoDuplicateKeyUpdateException" ) ;
4343 } catch ( Exception e ) {
4444
@@ -56,10 +56,10 @@ public void TestMultiUpdate(){
5656
5757 bool thrown = false ;
5858 try {
59- col . UpdateAll ( new Document ( ) { { "x" , 1 } } , new Document ( ) { { "y" , 2 } } , true ) ;
59+ col . UpdateAll ( new Document { { "x" , 1 } } , new Document { { "y" , 2 } } , true ) ;
6060 } catch ( MongoDuplicateKeyUpdateException ) {
6161 thrown = true ;
62- } catch ( MongoDuplicateKeyException mdk ) {
62+ } catch ( MongoDuplicateKeyException ) {
6363 Assert . Fail ( "MongoDuplicateKeyException thown instead of MongoDuplicateKeyUpdateException" ) ;
6464 } catch ( Exception e ) {
6565
@@ -70,9 +70,9 @@ public void TestMultiUpdate(){
7070
7171 protected IMongoCollection InitCollection ( string name ) {
7272 IMongoCollection col = DB [ name ] ;
73- col . MetaData . CreateIndex ( new Document ( ) { { "x" , IndexOrder . Ascending } } , true ) ;
73+ col . MetaData . CreateIndex ( new Document { { "x" , IndexOrder . Ascending } } , true ) ;
7474 for ( int x = 0 ; x < 5 ; x ++ ) {
75- col . Insert ( new Document ( ) { { "x" , x } , { "y" , 1 } } ) ;
75+ col . Insert ( new Document { { "x" , x } , { "y" , 1 } } ) ;
7676 }
7777 return col ;
7878 }
0 commit comments