Example #1
0
        public void SetJumps_ReadJumps()
        {
            var jumpTable = new JumpTable(new Jump('a', "10"), new Jump('b', "20"));

            Assert.That(jumpTable.Jump('a'), Is.EqualTo("10"));
            Assert.That(jumpTable.Jump('b'), Is.EqualTo("20"));
        }
Example #2
0
        public void JumpNotSet_Error()
        {
            var jumpTable = new JumpTable();

            Assert.Throws <KeyNotFoundException>(() => jumpTable.Jump('a'));
        }
Example #3
0
 public State(string id, IEnumerable <Jump> jumps, [CanBeNull] string title)
 {
     Id        = id;
     Title     = title ?? "<No title>";
     jumpTable = new JumpTable(jumps);
 }
Example #4
0
 public State(string id, JumpTable jumpTable, [CanBeNull] string title)
     : this(id, jumpTable.GetAllJumps(), title)
 {
 }