示例#1
0
        private static TestAccount Load(string name)
        {
            if (string.IsNullOrEmpty(name))
                throw new ArgumentException("must be populated", "name");

            var fileName = GetFileName(name);
            TestAccount account;
            if (File.Exists(fileName))
            {
                using (var fs = File.Open(fileName, FileMode.Open))
                    account = JsonSerializer.DeserializeFromStream<TestAccount>(fs);
            }
            else
            {
                account = new TestAccount
                    {
                        Name = name
                    };
            }
            return account;
        }
示例#2
0
 async public static Task in2bitstest(this GitHubApi api, IEnumerable <Scopes> scopes = null, string note = null)
 {
     await TestAccount.Auth("in2bitstest", api, scopes);
 }