예제 #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
파일: ApiKey_Tests.cs 프로젝트: kid/evelib
 public void IsValidKey_InvalidKey_NoExceptions() {
     var key = new ApiKey(0, "invalid");
     Assert.AreEqual(false, key.IsValidKey());
 }
예제 #4
0
파일: ApiKey_Tests.cs 프로젝트: kid/evelib
 public async Task IsValidKeyAsync_InvalidKey_NoExceptions() {
     var key = new ApiKey(0, "invalid");
     Assert.AreEqual(false, await key.IsValidKeyAsync());
 }
예제 #5
0
파일: CharacterKey.cs 프로젝트: kid/evelib
 /// <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());
 }