示例#1
0
 public void ReplaceAccessTokenTest()
 {
     using (Tokenio.User.TokenClient tokenClient = TestUtil.CreateClient())
     {
         UserMember grantor      = tokenClient.CreateMemberBlocking(TestUtil.RandomAlias());
         string     accountId    = grantor.CreateTestBankAccountBlocking(1000, "EUR").Id();
         Alias      granteeAlias = TestUtil.RandomAlias();
         UserMember grantee      = tokenClient.CreateMemberBlocking(granteeAlias);
         CreateAndEndorseAccessTokenSample.CreateBalanceAccessToken(grantor, accountId, granteeAlias);
         Token activeToken = ReplaceAccessTokenSample.FindAccessToken(tokenClient, grantor, granteeAlias);
         ReplaceAccessTokenSample.ReplaceAccessToken(grantor, granteeAlias, activeToken);
         Assert.NotEqual(ReplaceAccessTokenSample.FindAccessToken(tokenClient, grantor, granteeAlias).Id,
                         activeToken.Id);
     }
 }