예제 #1
0
        private void testCorporationSheet(CorporationSheet cs)
        {
            Assert.AreEqual(150212025, cs.CorporationId);
            Assert.AreEqual("Banana Republic", cs.CorporationName);
            Assert.AreEqual("BR", cs.Ticker);
            Assert.AreEqual(150208955, cs.CeoId);
            Assert.AreEqual("Mark Roled", cs.CeoName);
            Assert.AreEqual(60003469, cs.StationId);
            Assert.AreEqual("Jita IV - Caldari Business Tribunal Information Center", cs.StationName);
            Assert.AreEqual("test description", cs.Description);
            Assert.AreEqual("some url", cs.Url);
            Assert.AreEqual(150430947, cs.AllianceId);
            Assert.AreEqual("The Dead Rabbits", cs.AllianceName);
            Assert.AreEqual(93.7, cs.TaxRate);
            Assert.AreEqual(3, cs.MemberCount);
            Assert.AreEqual(6300, cs.MemberLimit);
            Assert.AreEqual(1, cs.Shares);

            Assert.AreEqual(7, cs.Divisions.Length);
            Assert.AreEqual(1000, cs.Divisions[0].AccountKey);
            Assert.AreEqual("1ST DIVISION", cs.Divisions[0].Description);

            Assert.AreEqual(7, cs.WalletDivisions.Length);
            Assert.AreEqual(1000, cs.WalletDivisions[0].AccountKey);
            Assert.AreEqual("Master Wallet", cs.WalletDivisions[0].Description);

            Assert.AreEqual(0, cs.Logo.GraphicId);
            Assert.AreEqual(448, cs.Logo.Shape1);
            Assert.AreEqual(0, cs.Logo.Shape2);
            Assert.AreEqual(418, cs.Logo.Shape3);
            Assert.AreEqual(681, cs.Logo.Color1);
            Assert.AreEqual(676, cs.Logo.Color2);
            Assert.AreEqual(0, cs.Logo.Color3);
        }
예제 #2
0
        public void GetCorporationSheet()
        {
            ResponseCache.Clear();
            CorporationSheet cs = EveApi.GetCorporationSheet(432435, 234523, "apiKey");

            testCorporationSheet(cs);

            ResponseCache.Clear();
            CorporationSheet cs2 = EveApi.GetCorporationSheet(432435, 234523, "apiKey", 2345);

            testCorporationSheet(cs2);
        }
예제 #3
0
        public void CorporationSheetPersist()
        {
            ResponseCache.Clear();
            CorporationSheet cs = EveApi.GetCorporationSheet(432435, 234523, "apiKey");

            ResponseCache.Save("ResponseCache.xml");
            ResponseCache.Clear();
            ResponseCache.Load("ResponseCache.xml");
            CorporationSheet cached = EveApi.GetCorporationSheet(432435, 234523, "apiKey");

            Assert.AreEqual(cs.CachedUntilLocal, cached.CachedUntilLocal);

            Assert.AreEqual(cs.CorporationId, cached.CorporationId);
            Assert.AreEqual(cs.CorporationName, cached.CorporationName);
            Assert.AreEqual(cs.Ticker, cached.Ticker);
            Assert.AreEqual(cs.CeoId, cached.CeoId);
            Assert.AreEqual(cs.CeoName, cached.CeoName);
            Assert.AreEqual(cs.StationId, cached.StationId);
            Assert.AreEqual(cs.StationName, cached.StationName);
            Assert.AreEqual(cs.Description, cached.Description);
            Assert.AreEqual(cs.Url, cached.Url);
            Assert.AreEqual(cs.AllianceId, cached.AllianceId);
            Assert.AreEqual(cs.AllianceName, cached.AllianceName);
            Assert.AreEqual(cs.TaxRate, cached.TaxRate);
            Assert.AreEqual(cs.MemberCount, cached.MemberCount);
            Assert.AreEqual(cs.MemberLimit, cached.MemberLimit);
            Assert.AreEqual(cs.Shares, cached.Shares);

            for (int i = 0; i < cs.Divisions.Length; i++)
            {
                Assert.AreEqual(cs.Divisions[i].AccountKey, cached.Divisions[i].AccountKey);
                Assert.AreEqual(cs.Divisions[i].Description, cached.Divisions[i].Description);
            }

            for (int i = 0; i < cs.WalletDivisions.Length; i++)
            {
                Assert.AreEqual(cs.WalletDivisions[i].AccountKey, cached.WalletDivisions[i].AccountKey);
                Assert.AreEqual(cs.WalletDivisions[i].Description, cached.WalletDivisions[i].Description);
            }

            Assert.AreEqual(cs.Logo.GraphicId, cached.Logo.GraphicId);
            Assert.AreEqual(cs.Logo.Shape1, cached.Logo.Shape1);
            Assert.AreEqual(cs.Logo.Shape2, cached.Logo.Shape2);
            Assert.AreEqual(cs.Logo.Shape3, cached.Logo.Shape3);
            Assert.AreEqual(cs.Logo.Color1, cached.Logo.Color1);
            Assert.AreEqual(cs.Logo.Color2, cached.Logo.Color2);
            Assert.AreEqual(cs.Logo.Color3, cached.Logo.Color3);
        }
예제 #4
0
        public static void CorporationSheetExample()
        {
            CorporationSheet corporationSheet = EveApi.GetCorporationSheet(452453, 452452, "apiKey");

            Console.WriteLine("Corporation Name: {0} Ticker: {1}", corporationSheet.CorporationName, corporationSheet.Ticker);
            Console.WriteLine("Logo GraphicId: {0}", corporationSheet.Logo.GraphicId);

            foreach (CorporationSheet.Division division in corporationSheet.Divisions)
            {
                Console.WriteLine("Division AccountKey: {0} Description: {1}", division.AccountKey, division.Description);
            }

            foreach (CorporationSheet.WalletDivision walletDivision in corporationSheet.WalletDivisions)
            {
                Console.WriteLine("Wallet Division AccountKey: {0} Description: {1}", walletDivision.AccountKey, walletDivision.Description);
            }
        }
예제 #5
0
        static void Main(string[] args)
        {
            if ((args.Length > 0) && (args[0].Contains("lol")))
            {
                args.ToList().Skip(1).ToList().ForEach(arg =>
                {
                    try
                    {
                        SendLossMessage(HyperFormatLolMessage(arg));
                    }
                    catch (Exception ex)
                    {
                        SendPM(ex.Message);
                    }
                });
            }
            else
            {
                try
                {
                    MessagePayload p = new MessagePayload();
                    p.Attachments = new List <MessagePayloadAttachment>();

                    if ((Properties.Settings.Default.CorpId == null) || (Properties.Settings.Default.CorpId == string.Empty))
                    {
                        CorporationSheet corpSheet = GetCorpDetails();
                        if (Properties.Settings.Default.Debug)
                        {
                            SendPM(string.Format("Corpsheet for {0} obtained.", corpSheet.Ticker));
                        }
                        CheckKills(corpSheet.Ticker, corpSheet.CorporationID);
                    }
                    else
                    {
                        CheckKills(Properties.Settings.Default.CorpTicker, Convert.ToInt64(Properties.Settings.Default.CorpId));
                    }
                }
                catch (Exception ex)
                {
                    SendPM(ex.Message);
                }
            }
        }