-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GetSessionAccessKeyResponseUnmarshaller Unit Tests (#69)
* GetSessionAccessKeyResponseUnmarshaller Unit Tests
- Loading branch information
1 parent
a3c3fc5
commit 6486ed4
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
aliyun-net-sdk-core.Tests/Auth/Sts/GetSessionAccessKeyResponseUnmarshaller.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Collections.Generic; | ||
|
||
using Aliyun.Acs.Core.Auth.Sts; | ||
using Aliyun.Acs.Core.Transform; | ||
|
||
using Xunit; | ||
|
||
namespace Aliyun.Acs.Core.UnitTests.Auth.Sts | ||
{ | ||
public class GetSessionAccessKeyResponseUnmarshallerTest | ||
{ | ||
[Fact] | ||
public void GetSessionAccessKeyResponseUnmarshallTest() | ||
{ | ||
UnmarshallerContext unmarshallerContext = new UnmarshallerContext(); | ||
if (unmarshallerContext.ResponseDictionary == null) | ||
{ | ||
unmarshallerContext.ResponseDictionary = new Dictionary<string, string> | ||
{ { "GetSessionAccessKey.RequestId", "RequestId" }, | ||
{ "GetSessionAccessKey.SessionAccessKey.SessionAccessKeyId", "SessionAccessKeyId" }, | ||
{ "GetSessionAccessKey.SessionAccessKey.SessionAccessKeySecret", "SessionAccessKeySecret" }, | ||
{ "GetSessionAccessKey.SessionAccessKey.Expiration", "100" } | ||
}; | ||
} | ||
|
||
GetSessionAccessKeyResponse response = GetSessionAccessKeyResponseUnmarshaller.Unmarshall(unmarshallerContext); | ||
Assert.Equal("RequestId", response.RequestId); | ||
Assert.Equal("SessionAccessKeyId", response.SessionAccesskey.SessionAccessKeyId); | ||
Assert.Equal("SessionAccessKeySecret", response.SessionAccesskey.SessionAccessKeySecert); | ||
Assert.Equal("100", response.SessionAccesskey.Expiration); | ||
} | ||
} | ||
} |