Ejemplo n.º 1
0
        public void CancelTransferTokenByGranteeTest()
        {
            using (Tokenio.Tpp.TokenClient tokenClient = TestUtil.CreateClient())
            {
                UserMember grantor      = TestUtil.CreateUserMember();
                Alias      granteeAlias = TestUtil.RandomAlias();
                TppMember  grantee      = tokenClient.CreateMemberBlocking(granteeAlias);

                Token token = CreateTransferTokenSample.CreateTransferToken(grantor, granteeAlias, Level.Low);
                TokenOperationResult result = CancelTokenSample.CancelTransferToken(grantee, token.Id);
                Assert.Equal(result.Status, TokenOperationResult.Types.Status.Success);
            }
        }
Ejemplo n.º 2
0
        public void CancelAccessTokenByGranteeTest()
        {
            using (Tokenio.Tpp.TokenClient tokenClient = TestUtil.CreateClient())
            {
                Tokenio.User.Member grantor = TestUtil.CreateUserMember();
                string    accountId         = grantor.GetAccountsBlocking()[0].Id();
                Alias     granteeAlias      = TestUtil.RandomAlias();
                TppMember grantee           = tokenClient.CreateMemberBlocking(granteeAlias);

                Token token =
                    CreateAndEndorseAccessTokenSample.CreateBalanceAccessToken(grantor, accountId, granteeAlias);
                TokenOperationResult result = CancelTokenSample.CancelAccessToken(grantee, token.Id);
                Assert.Equal(result.Status, TokenOperationResult.Types.Status.Success);
            }
        }