public void ProcessSingleEntry(string journalEntry, string minorFaction, Mission mission, StarSystem system, IEnumerable <MissionSummaryEntry> expectedSummaryEntries) { MissionCompletedEntryProcessor missionCompletedEventProcessor = new MissionCompletedEntryProcessor(); PilotState pilotState = new PilotState(); // pilotState.Missions.Add(mission.Id, mission); GalaxyState galaxyState = new GalaxyState(); // galaxyState.Systems.Add(system.SystemAdddress, system); JObject entry = new JournalEntryParser().Parse(journalEntry); IEnumerable <SummaryEntry> entries = missionCompletedEventProcessor.Process(pilotState, galaxyState, minorFaction, entry); Assert.That(entries, Is.Empty); }
public void ProcessSingleEntry(string journalEntry, string supportedMinorFaction, IEnumerable <RedeemVoucherSummaryEntry> expectedSummaryEntries) { RedeemVoucherEntryProcessor dockedEventProcessor = new RedeemVoucherEntryProcessor(); PilotState pilotState = new PilotState(); pilotState.LastDockedStation = new Station("Quetelet Dock", 1, "The Sovereign Justice Collective"); GalaxyState galaxyState = new GalaxyState(); galaxyState.Systems[1] = new StarSystem(1, "Afli", new string[] { "The Sovereign Justice Collective", "Afli Silver Universal Exchange" }); JObject entry = new JournalEntryParser().Parse(journalEntry); Assert.That( dockedEventProcessor.Process(pilotState, galaxyState, supportedMinorFaction, entry).Cast <RedeemVoucherSummaryEntry>(), Is.EquivalentTo(expectedSummaryEntries)); }
public void ProcessSingleEntry(string journalEntry, string minorFaction, string expectedStationName, long expectedSystemAddress, string expectedControllingMinorFaction) { DockedEntryProcessor dockedEventProcessor = new DockedEntryProcessor(); PilotState pilotState = new PilotState(); GalaxyState galaxyState = new GalaxyState(); Station station = new Station(expectedStationName, expectedSystemAddress, expectedControllingMinorFaction); galaxyState.AddOrUpdateStation(station); JObject entry = new JournalEntryParser().Parse(journalEntry); IEnumerable <SummaryEntry> entries = dockedEventProcessor.Process(pilotState, galaxyState, minorFaction, entry); Assert.That(entries, Is.Empty); Assert.That(pilotState.Missions, Is.Empty); Assert.That(pilotState.LastDockedStation, Is.EqualTo(station)); }
public void ProcessSingleEntry(string journalEntry, string minorFaction, string expectedStationName, long expectedSystemAddress, string expectedSystemName, string expectedStationControllingMinorFaction, string[] expectedMinorFactions, string expectedSystemMinorFaction) { LocationEntryProcessor locationEntryProcessor = new LocationEntryProcessor(); PilotState pilotState = new PilotState(); GalaxyState galaxyState = new GalaxyState(); JObject entry = new JournalEntryParser().Parse(journalEntry); IEnumerable <SummaryEntry> entries = locationEntryProcessor.Process(pilotState, galaxyState, minorFaction, entry); Assert.That(entries, Is.Empty); Assert.That(pilotState.Missions, Is.Empty); Assert.That(pilotState.LastDockedStation, Is.Not.Null); Assert.That(pilotState.LastDockedStation.Name, Is.EqualTo(expectedStationName)); Assert.That(pilotState.LastDockedStation.SystemAddress, Is.EqualTo(expectedSystemAddress)); Assert.That(pilotState.LastDockedStation.ControllingMinorFaction, Is.EqualTo(expectedStationControllingMinorFaction)); Assert.That(galaxyState.Systems, Has.Count.EqualTo(1)); Assert.That(galaxyState.Systems[expectedSystemAddress], Is.EqualTo(new StarSystem(expectedSystemAddress, expectedSystemName, expectedMinorFactions))); Assert.That(galaxyState.Stations, Has.Count.EqualTo(1)); Assert.That(galaxyState.Stations, Is.EquivalentTo(new[] { new Station(expectedStationName, expectedSystemAddress, expectedStationControllingMinorFaction) })); }
public void ProcessSingleEntry(string journalEntry, string minorFaction, long expectedMissionID, string expectedName, string expectedSourceMinorFactionName, string expectedTargetMinorFactionName, string expectedDestinationSystem) { MissionAcceptedEntryProcessor missionAcceptedEventProcessor = new MissionAcceptedEntryProcessor(); PilotState pilotState = new PilotState(); GalaxyState galaxyState = new GalaxyState(); JObject entry = new JournalEntryParser().Parse(journalEntry); IEnumerable <SummaryEntry> entries = missionAcceptedEventProcessor.Process(pilotState, galaxyState, minorFaction, entry); Assert.That(entries, Is.Empty); Assert.That(pilotState.LastDockedStation, Is.Null); Assert.That(pilotState.Missions, Has.Count.EqualTo(1)); Assert.That(pilotState.Missions.ContainsKey(expectedMissionID), Is.True); Assert.That(pilotState.Missions[expectedMissionID], Has.Property("Id").EqualTo(expectedMissionID)); Assert.That(pilotState.Missions[expectedMissionID], Has.Property("Name").EqualTo(expectedName)); // TODO: Fix // Assert.That(pilotState.Missions[expectedMissionID], Has.Property("Influence").EqualTo(expectedInfluence)); //Assert.That(pilotState.Missions[expectedMissionID], Has.Property("SourceMinorFactionName").EqualTo(expectedSourceMinorFactionName)); //Assert.That(pilotState.Missions[expectedMissionID], Has.Property("TargetMinorFactionName").EqualTo(expectedTargetMinorFactionName)); //Assert.That(pilotState.Missions[expectedMissionID], Has.Property("DestinationSystem").EqualTo(expectedDestinationSystem)); }