@@ -141,7 +141,7 @@ public async Task CreateDeleteAndTryRetrieveCharacterAsync_ShouldRemoveFromDatab
141141 existsBefore . Should ( ) . BeTrue ( ) ;
142142
143143 // Act - Delete
144- await _characterService . DeleteCharacterAsync ( createdCharacter . Id ) ;
144+ await _characterService . DeleteCharacterAsync ( createdCharacter . Id , createCommand . UserId ! . Value ) ;
145145
146146 // Assert - Should not exist
147147 var existsAfter = await _characterService . CharacterExistsAsync ( createdCharacter . Id ) ;
@@ -160,24 +160,26 @@ public async Task DeleteNonExistentCharacter_ShouldThrowNotFoundException()
160160 var nonExistentId = Guid . NewGuid ( ) ;
161161
162162 // Act & Assert
163+ var userId = Guid . NewGuid ( ) ;
163164 await Assert . ThrowsAsync < NotFoundException > (
164- ( ) => _characterService . DeleteCharacterAsync ( nonExistentId ) ) ;
165+ ( ) => _characterService . DeleteCharacterAsync ( nonExistentId , userId ) ) ;
165166 }
166167
167168 [ Fact ]
168169 public async Task DeleteCharacterFromMultipleCharacters_ShouldOnlyDeleteSpecificCharacter ( )
169170 {
170171 // Arrange
171172 await _fixture . ClearDatabaseAsync ( ) ;
172- var character1 = await _characterService . CreateCharacterWithFieldsAsync (
173- TestDataBuilder . CreateCreateCharacterWithFieldsCommand ( "Character 1" ) ) ;
174- var character2 = await _characterService . CreateCharacterWithFieldsAsync (
175- TestDataBuilder . CreateCreateCharacterWithFieldsCommand ( "Character 2" ) ) ;
176- var character3 = await _characterService . CreateCharacterWithFieldsAsync (
177- TestDataBuilder . CreateCreateCharacterWithFieldsCommand ( "Character 3" ) ) ;
173+ var command1 = TestDataBuilder . CreateCreateCharacterWithFieldsCommand ( "Character 1" ) ;
174+ var command2 = TestDataBuilder . CreateCreateCharacterWithFieldsCommand ( "Character 2" ) ;
175+ var command3 = TestDataBuilder . CreateCreateCharacterWithFieldsCommand ( "Character 3" ) ;
176+
177+ var character1 = await _characterService . CreateCharacterWithFieldsAsync ( command1 ) ;
178+ var character2 = await _characterService . CreateCharacterWithFieldsAsync ( command2 ) ;
179+ var character3 = await _characterService . CreateCharacterWithFieldsAsync ( command3 ) ;
178180
179181 // Act - Delete middle character
180- await _characterService . DeleteCharacterAsync ( character2 . Id ) ;
182+ await _characterService . DeleteCharacterAsync ( character2 . Id , command2 . UserId ! . Value ) ;
181183
182184 // Assert
183185 var allCharacters = await _characterService . GetAllCharactersAsync ( ) ;
@@ -255,7 +257,7 @@ public async Task CompleteCharacterLifecycle_ShouldWorkCorrectly()
255257 retrievedAfterUpdate . Name . Should ( ) . Be ( "Updated Lifecycle Character" ) ;
256258
257259 // Delete
258- await _characterService . DeleteCharacterAsync ( createdCharacter . Id ) ;
260+ await _characterService . DeleteCharacterAsync ( createdCharacter . Id , createCommand . UserId ! . Value ) ;
259261
260262 // Verify deletion
261263 var existsAfterDelete = await _characterService . CharacterExistsAsync ( createdCharacter . Id ) ;
0 commit comments