/// <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; }
/// <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())); }
public void IsValidKey_InvalidKey_NoExceptions() { var key = new ApiKey(0, "invalid"); Assert.AreEqual(false, key.IsValidKey()); }
public async Task IsValidKeyAsync_InvalidKey_NoExceptions() { var key = new ApiKey(0, "invalid"); Assert.AreEqual(false, await key.IsValidKeyAsync()); }
/// <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()); }