コード例 #1
0
        public void HashCode()
        {
            HashSet <int> hashCodes = new HashSet <int>();

            foreach (var item in VsoTokenScope.EnumerateValues())
            {
                Assert.IsTrue(hashCodes.Add(item.GetHashCode()));
            }

            int loop1 = 0;

            foreach (var item1 in VsoTokenScope.EnumerateValues())
            {
                int loop2 = 0;

                foreach (var item2 in VsoTokenScope.EnumerateValues())
                {
                    if (loop1 < loop2)
                    {
                        Assert.IsTrue(hashCodes.Add((item1 | item2).GetHashCode()));
                    }
                    else
                    {
                        Assert.IsFalse(hashCodes.Add((item1 | item2).GetHashCode()));
                    }

                    loop2++;
                }

                loop1++;
            }
        }
コード例 #2
0
 public async Task <Token> GeneratePersonalAccessToken(Uri targetUri, Token accessToken, VsoTokenScope tokenScope, bool requireCompactToken)
 {
     return(await Task.Run(() => { return new Token("personal-access-token", TokenType.Personal); }));
 }
コード例 #3
0
 public async Task<Token> GeneratePersonalAccessToken(Uri targetUri, Token accessToken, VsoTokenScope tokenScope, bool requireCompactToken)
 {
     return await Task.Run(() => { return new Token("personal-access-token", TokenType.Personal); });
 }