示例#1
0
文件: ApiKey.cs 项目: kid/evelib
 /// <summary>
 ///     Creates a new ApiKey using data from an existing key.
 /// </summary>
 /// <param name="key"></param>
 protected ApiKey(ApiKey key) {
     Contract.Requires(key != null);
     ApiKeyInfo = key.ApiKeyInfo;
     _isValidKey = key._isValidKey;
     KeyId = key.KeyId;
     VCode = key.VCode;
 }
示例#2
0
 /// <summary>
 ///     Creates a new CorporationKey using data from an existing ApiKey
 /// </summary>
 /// <param name="key"></param>
 internal CorporationKey(ApiKey key)
     : base(key) {
     _corporation = new Lazy<Corporation>(() => new Corporation(this, ApiKeyInfo.KeyEntities.Single()));
 }
示例#3
0
 public void IsValidKey_InvalidKey_NoExceptions() {
     var key = new ApiKey(0, "invalid");
     Assert.AreEqual(false, key.IsValidKey());
 }
示例#4
0
 public async Task IsValidKeyAsync_InvalidKey_NoExceptions() {
     var key = new ApiKey(0, "invalid");
     Assert.AreEqual(false, await key.IsValidKeyAsync());
 }
示例#5
0
 /// <summary>
 ///     Creates a new CharacterKey using data from an existing key
 /// </summary>
 /// <param name="key"></param>
 internal CharacterKey(ApiKey key)
     : base(key) {
     _characters =
         new Lazy<ReadOnlyCollection<Character>>(
             () => ApiKeyInfo.KeyEntities.Select(c => new Character(this, c)).ToList().AsReadOnly());
 }