Пример #1
0
        public void GetCharJournalEntriesTest()
        {
            JournalEntries.VersionCheck = false;
            JournalEntries journal = EveApi.GetJournalEntryList(JournalEntryType.Character, 0, 0, "apiKey");

            JournalEntries.JournalEntryItem journalEntry = journal.JournalEntryItems[0];
            Assert.AreEqual(1578932679, journalEntry.RefId);
            Assert.AreEqual(54, journalEntry.RefTypeId);
            Assert.AreEqual("corpslave", journalEntry.OwnerName1);
            Assert.AreEqual(150337897, journalEntry.OwnerId1);
            Assert.AreEqual("Secure Commerce Commission", journalEntry.OwnerName2);
            Assert.AreEqual(1000132, journalEntry.OwnerId2);
            Assert.AreEqual("", journalEntry.ArgName1);
            Assert.AreEqual(0, journalEntry.ArgId1);
            Assert.AreEqual(-8396.99, journalEntry.Amount);
            Assert.AreEqual(576336941.61, journalEntry.Balance);
            Assert.AreEqual("", journalEntry.Reason);
        }
Пример #2
0
        /// <summary>
        /// Create an JournalEntryItem by parsing a single row
        /// </summary>
        /// <param name="journalTransactionRow"></param>
        /// <returns></returns>
        private static JournalEntries.JournalEntryItem ParseTransactionRow(XmlNode journalTransactionRow)
        {
            JournalEntries.JournalEntryItem journalEntryItem = new JournalEntries.JournalEntryItem();

            journalEntryItem.Date       = TimeUtilities.ConvertCCPTimeStringToDateTimeUTC(journalTransactionRow.Attributes["date"].InnerText);
            journalEntryItem.DateLocal  = TimeUtilities.ConvertCCPToLocalTime(journalEntryItem.Date);
            journalEntryItem.RefId      = Convert.ToInt32(journalTransactionRow.Attributes["refID"].InnerText, CultureInfo.InvariantCulture);
            journalEntryItem.RefTypeId  = Convert.ToInt32(journalTransactionRow.Attributes["refTypeID"].InnerText, CultureInfo.InvariantCulture);
            journalEntryItem.OwnerName1 = journalTransactionRow.Attributes["ownerName1"].InnerText;
            journalEntryItem.OwnerId1   = Convert.ToInt32(journalTransactionRow.Attributes["ownerID1"].InnerText, CultureInfo.InvariantCulture);
            journalEntryItem.OwnerName2 = journalTransactionRow.Attributes["ownerName2"].InnerText;
            journalEntryItem.OwnerId2   = Convert.ToInt32(journalTransactionRow.Attributes["ownerID2"].InnerText, CultureInfo.InvariantCulture);
            journalEntryItem.ArgName1   = journalTransactionRow.Attributes["argName1"].InnerText;
            journalEntryItem.ArgId1     = Convert.ToInt32(journalTransactionRow.Attributes["argID1"].InnerText, CultureInfo.InvariantCulture);
            journalEntryItem.Amount     = Convert.ToDouble(journalTransactionRow.Attributes["amount"].InnerText, CultureInfo.InvariantCulture);
            journalEntryItem.Balance    = Convert.ToDouble(journalTransactionRow.Attributes["balance"].InnerText, CultureInfo.InvariantCulture);
            journalEntryItem.Reason     = journalTransactionRow.Attributes["reason"].InnerText;

            return(journalEntryItem);
        }