Esempio n. 1
0
        public void PapyrusParser_ParseInstruction()
        {
            var parser = new PapyrusAssemblyInstructionParser();
            var inst   = parser.ParseInstruction("CALLMETHOD OnEndState self ::nonevar 1 asNewState ;@line 8");

            Assert.AreEqual(PapyrusOpCodes.Callmethod, inst.GetOpCode());
            Assert.AreEqual(2, inst.GetOperandArguments().Count);
            Assert.AreEqual(3, inst.GetArguments().Count);
        }
Esempio n. 2
0
        public void PapyrusParser_ParseInstruction_AdditionalSpaces()
        {
            var parser = new PapyrusAssemblyInstructionParser();
            var inst   = parser.ParseInstruction("CALLMETHOD      OnEndState self    ::nonevar 1   asNewState    ;@line 8");

            Assert.AreEqual(PapyrusOpCodes.Callmethod, inst.GetOpCode());
            Assert.AreEqual(2, inst.GetOperandArguments().Count);
            Assert.IsTrue(inst.GetOperandArguments().All(j => !j.Value.Contains(" ")));
            Assert.AreEqual(3, inst.GetArguments().Count);
            Assert.IsTrue(inst.GetArguments().All(j => !j.Value.Contains(" ")));
        }