@@ -21,33 +21,33 @@ public async Task TestMigrationStep3()
2121 string partitionKey = Guid . NewGuid ( ) . ToString ( ) ;
2222 string [ ] sortKeys = { "0" , "1" , "2" , "3" } ;
2323
24- // Given: Step 0 has succeeded
25- bool success = await MigrationStep0 . MigrationStep0Example ( tableName , partitionKey , sortKeys [ 0 ] , sortKeys [ 0 ] ) ;
26- Assert . True ( success , "MigrationStep0 should complete successfully" ) ;
27-
28- // Given: Step 1 has succeeded
29- success = await MigrationStep1 . MigrationStep1Example ( kmsKeyID , tableName , partitionKey , sortKeys [ 1 ] , sortKeys [ 1 ] ) ;
30- Assert . True ( success , "MigrationStep1 should complete successfully" ) ;
31-
32- // Given: Step 2 has succeeded
33- success = await MigrationStep2 . MigrationStep2Example ( kmsKeyID , tableName , partitionKey , sortKeys [ 2 ] , sortKeys [ 2 ] ) ;
34- Assert . True ( success , "MigrationStep2 should complete successfully" ) ;
35-
3624 // Successfully executes step 3
3725 success = await MigrationStep3 . MigrationStep3Example ( kmsKeyID , tableName , partitionKey , sortKeys [ 3 ] , sortKeys [ 3 ] ) ;
3826 Assert . True ( success , "MigrationStep3 should complete successfully" ) ;
3927
28+ // Given: Step 0 has succeeded
29+ bool success = await MigrationStep0 . MigrationStep0Example ( tableName , partitionKey , sortKeys [ 0 ] , sortKeys [ 0 ] ) ;
30+ Assert . True ( success , "MigrationStep0 should complete successfully" ) ;
31+
4032 // When: Execute Step 3 with sortReadValue=0, Then: should error out when reading plaintext items from Step 0
4133 var exception = await Assert . ThrowsAsync < DynamoDbItemEncryptorException > ( ( ) =>
4234 MigrationStep3 . MigrationStep3Example ( kmsKeyID , tableName , partitionKey , sortKeys [ 3 ] , sortKeys [ 0 ] ) ) ;
4335
44- Assert . Contains ( "encrypted item missing expected header and footer attributes" , exception . Message . ToLower ( ) ) ;
36+ // Given: Step 1 has succeeded
37+ success = await MigrationStep1 . MigrationStep1Example ( kmsKeyID , tableName , partitionKey , sortKeys [ 1 ] , sortKeys [ 1 ] ) ;
38+ Assert . True ( success , "MigrationStep1 should complete successfully" ) ;
4539
4640 // When: Execute Step 3 with sortReadValue=1, Then: should error out when reading plaintext items from Step 1
4741 exception = await Assert . ThrowsAsync < DynamoDbItemEncryptorException > ( ( ) =>
4842 MigrationStep3 . MigrationStep3Example ( kmsKeyID , tableName , partitionKey , sortKeys [ 3 ] , sortKeys [ 1 ] ) ) ;
4943 Assert . Contains ( "encrypted item missing expected header and footer attributes" , exception . Message . ToLower ( ) ) ;
5044
45+ // Given: Step 2 has succeeded
46+ success = await MigrationStep2 . MigrationStep2Example ( kmsKeyID , tableName , partitionKey , sortKeys [ 2 ] , sortKeys [ 2 ] ) ;
47+ Assert . True ( success , "MigrationStep2 should complete successfully" ) ;
48+
49+ Assert . Contains ( "encrypted item missing expected header and footer attributes" , exception . Message . ToLower ( ) ) ;
50+
5151 // When: Execute Step 3 with sortReadValue=2, Then: Success (i.e. can read encrypted values from Step 2)
5252 success = await MigrationStep3 . MigrationStep3Example ( kmsKeyID , tableName , partitionKey , sortKeys [ 3 ] , sortKeys [ 2 ] ) ;
5353 Assert . True ( success , "MigrationStep3 should be able to read items written by Step 2" ) ;
0 commit comments