@@ -123,7 +123,8 @@ public void Database_WAL_Recovery_ReplaysTransactions()
123123 public void Database_Index_Lookup_FasterThanScan ( )
124124 {
125125 // Arrange
126- var db = _factory . Create ( _testDbPath , "password" ) ;
126+ var config = new DatabaseConfig { EnableQueryCache = false } ;
127+ var db = _factory . Create ( _testDbPath , "password" , config : config ) ;
127128 db . ExecuteSQL ( "CREATE TABLE indexed_table (id INTEGER, category TEXT, value INTEGER)" ) ;
128129 db . ExecuteSQL ( "CREATE INDEX idx_category ON indexed_table (category)" ) ;
129130
@@ -600,15 +601,10 @@ public void Database_ReadOnly_Update_DoesNotPersist()
600601 // Create readonly connection
601602 var dbReadonly = _factory . Create ( _testDbPath , "testPassword" , isReadOnly : true ) ;
602603
603- // Act - Update operation on readonly doesn't throw but doesn't persist either
604- dbReadonly . ExecuteSQL ( "UPDATE users SET name = @0 WHERE id = @1" , new Dictionary < string , object ? > { { "0" , "Bob" } , { "1" , 1 } } ) ;
605-
606- // Assert - Verify data hasn't changed by reading from a new connection
607- var db2 = _factory . Create ( _testDbPath , "testPassword" ) ;
608- db2 . ExecuteSQL ( "SELECT * FROM users WHERE id = @0" , new Dictionary < string , object ? > { { "0" , 1 } } ) ;
609-
610- // Test passes if no exception is thrown during readonly update
611- Assert . True ( true ) ;
604+ // Act & Assert - Update operation on readonly should throw InvalidOperationException
605+ Assert . Throws < InvalidOperationException > ( ( ) =>
606+ dbReadonly . ExecuteSQL ( "UPDATE users SET name = @0 WHERE id = @1" , new Dictionary < string , object ? > { { "0" , "Bob" } , { "1" , 1 } } )
607+ ) ;
612608 }
613609
614610 [ Fact ]
@@ -622,15 +618,10 @@ public void Database_ReadOnly_Delete_DoesNotPersist()
622618 // Create readonly connection
623619 var dbReadonly = _factory . Create ( _testDbPath , "testPassword" , isReadOnly : true ) ;
624620
625- // Act - Delete operation on readonly doesn't throw but doesn't persist either
626- dbReadonly . ExecuteSQL ( "DELETE FROM users WHERE id = @0" , new Dictionary < string , object ? > { { "0" , 1 } } ) ;
627-
628- // Assert - Verify data hasn't changed by reading from a new connection
629- var db2 = _factory . Create ( _testDbPath , "testPassword" ) ;
630- db2 . ExecuteSQL ( "SELECT * FROM users WHERE id = @0" , new Dictionary < string , object ? > { { "0" , 1 } } ) ;
631-
632- // Test passes if no exception is thrown during readonly delete
633- Assert . True ( true ) ;
621+ // Act & Assert - Delete operation on readonly should throw InvalidOperationException
622+ Assert . Throws < InvalidOperationException > ( ( ) =>
623+ dbReadonly . ExecuteSQL ( "DELETE FROM users WHERE id = @0" , new Dictionary < string , object ? > { { "0" , 1 } } )
624+ ) ;
634625 }
635626
636627 [ Fact ]
0 commit comments