File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Src/Support/IntegrationTests Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,10 @@ limitations under the License.
2222using Google . Apis . Storage . v1 . Data ;
2323using IntegrationTests . Utils ;
2424using System ;
25+ using System . Linq ;
2526using System . Net . Http ;
2627using System . Threading . Tasks ;
27- using System . Xml ;
28+ using System . Xml . Linq ;
2829using Xunit ;
2930
3031namespace IntegrationTests
@@ -76,8 +77,7 @@ public async Task AwsCredentials()
7677 HttpResponseMessage response = await httpClient . GetAsync ( assumeRoleUrl ) ;
7778 content = await response . Content . ReadAsStringAsync ( ) ;
7879 }
79- XmlDocument awsCredentialXml = new XmlDocument ( ) ;
80- awsCredentialXml . LoadXml ( content ) ;
80+ XElement awsCredentialXml = XElement . Parse ( content ) ;
8181
8282 // We store AWS credentials in environment variables to mimic an AWS environment.
8383 Environment . SetEnvironmentVariable ( "AWS_ACCESS_KEY_ID" , AwsCredentialValue ( "AccessKeyId" ) ) ;
@@ -109,7 +109,8 @@ public async Task AwsCredentials()
109109 // A final sanity-check.
110110 Assert . NotNull ( buckets . Items ) ;
111111
112- string AwsCredentialValue ( string tagName ) => awsCredentialXml . GetElementsByTagName ( tagName ) [ 0 ] . InnerText ;
112+ string AwsCredentialValue ( string tagName ) =>
113+ awsCredentialXml . Descendants ( ) . Where ( element => element . Name . LocalName == tagName ) . Single ( ) . Value ;
113114 }
114115 }
115116}
You can’t perform that action at this time.
0 commit comments