using EDPlayerJournal; using EDPlayerJournal.BGS; using EDPlayerJournal.Entries; namespace EDPlayerJournalTests; [TestClass] public class ThargoidKills { [TestMethod] public void ThargoidBonks() { TransactionParser parser = new(); List? entries = Helper.LoadTestData("ThargoidKills.txt"); Assert.IsNotNull(entries, "could not load test data"); if (entries == null) { return; } List? transactions = parser.Parse(entries)?.OfType().ToList(); Assert.IsNotNull(transactions, "could not parse entries"); Assert.AreEqual(transactions.Count, 3); Assert.IsInstanceOfType(transactions[0], typeof(ThargoidKill), "result is not of type ThargoidKill"); Assert.AreEqual(transactions[0].ThargoidType, EDPlayerJournal.ThargoidVessel.Scout); Assert.IsInstanceOfType(transactions[1], typeof(ThargoidKill), "result is not of type ThargoidKill"); Assert.AreEqual(transactions[1].ThargoidType, EDPlayerJournal.ThargoidVessel.Basilisk); Assert.IsInstanceOfType(transactions[2], typeof(ThargoidKill), "result is not of type ThargoidKill"); Assert.AreEqual(transactions[2].ThargoidType, EDPlayerJournal.ThargoidVessel.Scout); } [TestMethod] public void ThargoidBonds() { TransactionParser parser = new(); List? entries = Helper.LoadTestData("ThargoidBonds.txt"); Assert.IsNotNull(entries, "could not load test data"); if (entries == null) { return; } List? transactions = parser.Parse(entries)?.OfType().ToList(); Assert.IsNotNull(transactions, "could not parse entries"); Assert.AreEqual(transactions.Count, 1); Assert.AreEqual(transactions[0].Faction, Factions.PilotsFederationVouchers); Assert.AreEqual(transactions[0].TotalSum, 24240000L); Assert.AreEqual(transactions[0].Type, "Combat Bond"); } }