public void AddMessage_MessageShouldBeAdded() { var entry = new RobotLogEntry("Robot has fired a tactical nuclear missile"); robotLog.AddEntry(entry); Assert.Single(robotLog.Entries, entry); }
public void AddMessage_MessageShouldBeAddedInOrder() { List <RobotLogEntry> entries = new List <RobotLogEntry>(); for (char c = 'a'; c <= 'z'; ++c) { var entry = new RobotLogEntry(c.ToString()); entries.Add(entry); robotLog.AddEntry(entry); } for (int i = 0; i < entries.Count; ++i) { Assert.Equal(entries[i], robotLog.Entries.ElementAt(i)); } }
public static void MakeEvent(RobotLogEntry entry, bool showHints, List <GridLogEvent> eventList) { foreach (var msg in entry.Messages) { var hint = RobotHint.ParseString(msg); if (hint != null && !showHints) { continue; } var evt = new GridLogEvent { Message = msg, Time = entry.Time, RobotTitle = entry.Robot.TypeName + ":" + entry.Robot.Magic }; eventList.Add(evt); } }
public RobotLogEntryViewModel(RobotLogEntry entry) : this(entry.Message, entry.Time) { }