From b803406a75716bc5883b369582ac3da2d5423c94 Mon Sep 17 00:00:00 2001 From: Malhar Khimsaria <96malhar@gmail.com> Date: Mon, 22 Apr 2024 12:18:03 -0700 Subject: [PATCH] Fix integration test (#143) --- .../SessionTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Amazon.Extensions.CognitoAuthentication.IntegrationTests/SessionTests.cs b/test/Amazon.Extensions.CognitoAuthentication.IntegrationTests/SessionTests.cs index 0891692..acdbdee 100644 --- a/test/Amazon.Extensions.CognitoAuthentication.IntegrationTests/SessionTests.cs +++ b/test/Amazon.Extensions.CognitoAuthentication.IntegrationTests/SessionTests.cs @@ -19,6 +19,7 @@ using Amazon.CognitoIdentityProvider.Model; using Amazon.Extensions.CognitoAuthentication.Util; +using System.Linq; namespace Amazon.Extensions.CognitoAuthentication.IntegrationTests { @@ -55,7 +56,7 @@ await user.StartWithSrpAuthAsync(new InitiateSrpAuthRequest() }).ConfigureAwait(false); GetUserResponse userDetails = await user.GetUserDetailsAsync().ConfigureAwait(false); - Assert.True(string.Equals(userDetails.UserAttributes[2].Name, CognitoConstants.UserAttrEmail, StringComparison.Ordinal)); + Assert.True(userDetails.UserAttributes.Any(x => string.Equals(x.Name, CognitoConstants.UserAttrEmail, StringComparison.Ordinal))); Assert.Empty(userDetails.MFAOptions); }