public long GetToonId(IDType type, int apiKey, string vcode) { long result = -1; try { var newkey = EveXml.CreateApiKey(apiKey, vcode).Init(); if ((newkey.IsValidKey()) && newkey.KeyType != (ApiKeyType.Corporation)) { var cKey = (CharacterKey)newkey.GetActualKey(); Character toon = null; try { toon = cKey.Characters.Single(c => c.CharacterName == this.UserName); } catch (Exception ex) { } if (toon != null) { if (type == IDType.Corporation) { result = toon.CharacterId; } } } else if ((newkey.IsValidKey()) && newkey.KeyType == (ApiKeyType.Corporation)) { var cKey = (CorporationKey)newkey.GetActualKey(); Corporation corp = cKey.Corporation; if (corp != null) { if (type == IDType.Corporation) { result = corp.GetCorporationSheet().Result.CeoId; } } } } catch (Exception ex) { } return(result); }
public void GetCorporationSheet() { EveXmlResponse <CorporationSheet> xml = _corp.GetCorporationSheet(); Assert.AreEqual(150212025, xml.Result.CorporationId); }
public void GetCorporationSheet() { var xml = _corp.GetCorporationSheet(); Assert.AreEqual(150212025, xml.Result.CorporationId); }