/// <summary> /// Create an WalletTransactionItem by parsing a single row /// </summary> /// <param name="walletTransactionRow"></param> /// <returns></returns> private static WalletTransactions.WalletTransactionItem ParseTransactionRow(XmlNode walletTransactionRow) { WalletTransactions.WalletTransactionItem walletTransactionItem = new WalletTransactions.WalletTransactionItem(); walletTransactionItem.TransactionDateTime = TimeUtilities.ConvertCCPTimeStringToDateTimeUTC(walletTransactionRow.Attributes["transactionDateTime"].InnerText); walletTransactionItem.TransactionDateTimeLocal = TimeUtilities.ConvertCCPToLocalTime(walletTransactionItem.TransactionDateTime); walletTransactionItem.TransactionId = Convert.ToInt32(walletTransactionRow.Attributes["transactionID"].InnerText, CultureInfo.InvariantCulture); walletTransactionItem.Quantity = Convert.ToInt32(walletTransactionRow.Attributes["quantity"].InnerText, CultureInfo.InvariantCulture); walletTransactionItem.TypeName = walletTransactionRow.Attributes["typeName"].InnerText; walletTransactionItem.TypeId = Convert.ToInt32(walletTransactionRow.Attributes["typeID"].InnerText, CultureInfo.InvariantCulture); walletTransactionItem.Price = (float)Convert.ToDouble(walletTransactionRow.Attributes["price"].InnerText, CultureInfo.InvariantCulture); walletTransactionItem.ClientId = Convert.ToInt32(walletTransactionRow.Attributes["clientID"].InnerText, CultureInfo.InvariantCulture); walletTransactionItem.ClientName = walletTransactionRow.Attributes["clientName"].InnerText; //These are only present in the corp version if (walletTransactionRow.Attributes.GetNamedItem("characterID") != null) { walletTransactionItem.CharacterId = Convert.ToInt32(walletTransactionRow.Attributes["characterID"].InnerText, CultureInfo.InvariantCulture); } if (walletTransactionRow.Attributes.GetNamedItem("characterName") != null) { walletTransactionItem.CharacterName = walletTransactionRow.Attributes["characterName"].InnerText; } walletTransactionItem.StationId = Convert.ToInt32(walletTransactionRow.Attributes["stationID"].InnerText, CultureInfo.InvariantCulture); walletTransactionItem.StationName = walletTransactionRow.Attributes["stationName"].InnerText; walletTransactionItem.TransactionType = walletTransactionRow.Attributes["transactionType"].InnerText; walletTransactionItem.TransactionFor = walletTransactionRow.Attributes["transactionFor"].InnerText; return(walletTransactionItem); }
public void GetCorpWalletTransactionsTest() { WalletTransactions walletTransactions = EveApi.GetWalletTransactionsList(WalletTransactionListType.Corporation, 0, 0, "apiKey"); WalletTransactions.WalletTransactionItem transaction = walletTransactions.WalletTransactionItems[0]; Assert.AreEqual(4, walletTransactions.WalletTransactionItems.Length); Assert.AreEqual(new DateTime(2008, 08, 04, 22, 01, 00), transaction.TransactionDateTime); Assert.AreEqual(705664738, transaction.TransactionId); Assert.AreEqual(50000, transaction.Quantity); Assert.AreEqual("Oxygen Isotopes", transaction.TypeName); Assert.AreEqual(17887, transaction.TypeId); Assert.AreEqual(250.00, transaction.Price); Assert.AreEqual(174312871, transaction.ClientId); Assert.AreEqual("ACHAR", transaction.ClientName); Assert.AreEqual(000000000, transaction.CharacterId); Assert.AreEqual("SELLER", transaction.CharacterName); Assert.AreEqual(60004375, transaction.StationId); Assert.AreEqual("SYSTEM IV - Moon 10 - Corporate Police Force Testing Facilities", transaction.StationName); Assert.AreEqual("buy", transaction.TransactionType); Assert.AreEqual("corporation", transaction.TransactionFor); }
public void GetCharWalletTransactionsTest() { WalletTransactions walletTransactions = EveApi.GetWalletTransactionsList(WalletTransactionListType.Character, 0, 0, "apiKey"); Assert.AreEqual(7, walletTransactions.WalletTransactionItems.Length); WalletTransactions.WalletTransactionItem transaction = walletTransactions.WalletTransactionItems[0]; Assert.AreEqual(7, walletTransactions.WalletTransactionItems.Length); Assert.AreEqual(new DateTime(2010, 02, 07, 03, 34, 00), transaction.TransactionDateTime); Assert.AreEqual(1309776438, transaction.TransactionId); Assert.AreEqual(1, transaction.Quantity); Assert.AreEqual("Information Warfare", transaction.TypeName); Assert.AreEqual(20495, transaction.TypeId); // Assert.AreEqual(34101.06, transaction.Price); Assert.AreEqual(1034922339, transaction.ClientId); Assert.AreEqual("Elthana", transaction.ClientName); Assert.AreEqual(60003760, transaction.StationId); Assert.AreEqual("Jita IV - Moon 4 - Caldari Navy Assembly Plant", transaction.StationName); Assert.AreEqual("buy", transaction.TransactionType); Assert.AreEqual("personal", transaction.TransactionFor); }