Skip to content

Commit e8e0ee8

Browse files
sethvargoamanda-tarafa
authored andcommitted
Address more review comments
1 parent 3ed91d3 commit e8e0ee8

32 files changed

Lines changed: 51 additions & 46 deletions

‎kms/api/Kms.Samples.Tests/DestroyKeyVersionTests.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public void DestroysKeyVersions()
4444
// Verify marked for deletion.
4545
var acceptableStates = new CryptoKeyVersion.Types.CryptoKeyVersionState[]
4646
{
47-
CryptoKeyVersion.Types.CryptoKeyVersionState.DestroyScheduled,
48-
CryptoKeyVersion.Types.CryptoKeyVersionState.Destroyed,
47+
CryptoKeyVersion.Types.CryptoKeyVersionState.DestroyScheduled,
48+
CryptoKeyVersion.Types.CryptoKeyVersionState.Destroyed,
4949
};
5050
Assert.Contains(response.State, acceptableStates);
5151
}

‎kms/api/Kms.Samples.Tests/IamAddMemberTests.cs‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
using Google.Cloud.Iam.V1;
1817
using Xunit;
1918

2019
[Collection(nameof(KmsFixture))]
@@ -37,18 +36,7 @@ public void AddsMember()
3736
projectId: _fixture.ProjectId, locationId: _fixture.LocationId, keyRingId: _fixture.KeyRingId, keyId: _fixture.AsymmetricDecryptKeyId,
3837
member: "group:test@google.com");
3938

40-
// Verify result.
41-
Binding role = null;
42-
foreach (var b in result.Bindings)
43-
{
44-
if (b.Role == "roles/cloudkms.cryptoKeyEncrypterDecrypter")
45-
{
46-
role = b;
47-
break;
48-
}
49-
}
50-
51-
Assert.NotNull(role);
52-
Assert.Contains("group:test@google.com", role.Members);
39+
Assert.Contains(result.Bindings,
40+
binding => binding.Role == "roles/cloudkms.cryptoKeyEncrypterDecrypter" && binding.Members.Contains("group:test@google.com"));
5341
}
5442
}

‎kms/api/Kms.Samples.Tests/IamRemoveMemberTests.cs‎

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
using Google.Cloud.Iam.V1;
1817
using Xunit;
1918

2019
[Collection(nameof(KmsFixture))]
@@ -37,20 +36,7 @@ public void RemovesMembers()
3736
projectId: _fixture.ProjectId, locationId: _fixture.LocationId, keyRingId: _fixture.KeyRingId, keyId: _fixture.AsymmetricSignEcKeyId,
3837
member: "group:test@google.com");
3938

40-
// Verify result.
41-
Binding role = null;
42-
foreach (var b in result.Bindings)
43-
{
44-
if (b.Role == "roles/cloudkms.cryptoKeyEncrypterDecrypter")
45-
{
46-
role = b;
47-
break;
48-
}
49-
}
50-
51-
if (role != null)
52-
{
53-
Assert.DoesNotContain("group:test@google.com", role.Members);
54-
}
39+
Assert.DoesNotContain(result.Bindings,
40+
binding => binding.Role == "roles/cloudkms.cryptoKeyEncrypterDecrypter" && binding.Members.Contains("group:test@google.com"));
5541
}
5642
}

‎kms/api/Kms.Samples/CreateKeyAsymmetricDecrypt.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
// [START kms_create_key_asymmetric_decrypt]
18+
1819
using Google.Cloud.Kms.V1;
1920

2021
public class CreateKeyAsymmetricDecryptSample

‎kms/api/Kms.Samples/CreateKeyAsymmetricSign.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
// [START kms_create_key_asymmetric_sign]
18+
1819
using Google.Cloud.Kms.V1;
1920

2021
public class CreateKeyAsymmetricSignSample

‎kms/api/Kms.Samples/CreateKeyHsm.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
// [START kms_create_key_hsm]
18+
1819
using Google.Cloud.Kms.V1;
1920

2021
public class CreateKeyHsmSample

‎kms/api/Kms.Samples/CreateKeyLabels.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
// [START kms_create_key_labels]
18+
1819
using Google.Cloud.Kms.V1;
1920

2021
public class CreateKeyLabelsSample

‎kms/api/Kms.Samples/CreateKeyRing.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
// [START kms_create_key_ring]
1818

19+
1920
using Google.Api.Gax.ResourceNames;
2021
using Google.Cloud.Kms.V1;
2122

‎kms/api/Kms.Samples/CreateKeyRotationSchedule.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
// [START kms_create_key_rotation_schedule]
18+
1819
using Google.Cloud.Kms.V1;
1920
using Google.Protobuf.WellKnownTypes;
2021
using System;

‎kms/api/Kms.Samples/CreateKeySymmetricEncryptDecrypt.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
// [START kms_create_key_symmetric_encrypt_decrypt]
1818

19+
1920
using Google.Cloud.Kms.V1;
2021

2122
public class CreateKeySymmetricEncryptDecryptSample

0 commit comments

Comments
 (0)