Ejemplo n.º 1
0
        public void AddMessage_MessageShouldBeAdded()
        {
            var entry = new RobotLogEntry("Robot has fired a tactical nuclear missile");

            robotLog.AddEntry(entry);

            Assert.Single(robotLog.Entries, entry);
        }
Ejemplo n.º 2
0
        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));
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
 public RobotLogEntryViewModel(RobotLogEntry entry) : this(entry.Message, entry.Time)
 {
 }