コード例 #1
0
        public void ParserRefusesInvalidExitDisassemblyCommand()
        {
            // --- Act
            var p = new RomEditorCommandParser("x 45BQ");

            // --- Assert
            p.Command.ShouldBe(RomEditorCommandType.Invalid);
        }
コード例 #2
0
        public void ParserRecognizesExitDisassemblyCommand2()
        {
            // --- Act
            var p = new RomEditorCommandParser("X");

            // --- Assert
            p.Command.ShouldBe(RomEditorCommandType.ExitDisass);
        }
コード例 #3
0
        public void ParserRefusesInvalidGotoCommand()
        {
            // --- Act
            var p = new RomEditorCommandParser("45BQ");

            // --- Assert
            p.Command.ShouldBe(RomEditorCommandType.Invalid);
        }
コード例 #4
0
        public void ParserRecognizesDisassemblyCommand2()
        {
            // --- Act
            var p = new RomEditorCommandParser("# 45BF");

            // --- Assert
            p.Command.ShouldBe(RomEditorCommandType.Disassemble);
            p.Address.ShouldBe((ushort)0x45BF);
        }
コード例 #5
0
        public void ParserRecognizesGotoCommand()
        {
            // --- Act
            var p = new RomEditorCommandParser("45BF");

            // --- Assert
            p.Command.ShouldBe(RomEditorCommandType.Goto);
            p.Address.ShouldBe((ushort)0x45BF);
        }
コード例 #6
0
        public void ParserRecognizesEmptyCommand()
        {
            // --- Act
            var p1 = new RomEditorCommandParser(null);
            var p2 = new RomEditorCommandParser("    ");

            // --- Assert
            p1.Command.ShouldBe(RomEditorCommandType.None);
            p2.Command.ShouldBe(RomEditorCommandType.None);
        }