EDBGS/EDPlayerJournalTests/ThargoidKills.cs
2022-11-28 11:00:11 +01:00

55 lines
2.0 KiB
C#

using EDPlayerJournal;
using EDPlayerJournal.BGS;
using EDPlayerJournal.Entries;
namespace EDPlayerJournalTests;
[TestClass]
public class ThargoidKills {
[TestMethod]
public void ThargoidBonks() {
TransactionParser parser = new();
List<Entry>? entries = Helper.LoadTestData("ThargoidKills.txt");
Assert.IsNotNull(entries, "could not load test data");
if (entries == null) {
return;
}
List<ThargoidKill>? transactions = parser.Parse(entries)?.OfType<ThargoidKill>().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<Entry>? entries = Helper.LoadTestData("ThargoidBonds.txt");
Assert.IsNotNull(entries, "could not load test data");
if (entries == null) {
return;
}
List<Vouchers>? transactions = parser.Parse(entries)?.OfType<Vouchers>().ToList();
Assert.IsNotNull(transactions, "could not parse entries");
Assert.AreEqual(transactions.Count, 1);
Assert.AreEqual(Factions.IsPilotsFederation(transactions[0].Faction), true);
Assert.AreEqual(transactions[0].TotalSum, 24240000L);
Assert.AreEqual(transactions[0].Type, "Combat Bond");
}
}