示例#1
0
 public void ShouldParseCorrectlyWithReturnExpression()
 {
     classUnderTest.LoadTokens(t1, t2, t3);
     classUnderTest.AddToSymbolTable("result", IdentifierKind.Var, "ResultClass");
     classUnderTest
     .ParseReturnStatement()
     .ShouldGenerateXml(@"
             <returnStatement>
                 <keyword>return</keyword>
                 <expression>
                     <term>
                         <identifier kind='var' isDefinition='false' number='0' classType='ResultClass'>result</identifier>
                     </term>
                 </expression>
                 <symbol>;</symbol>
             </returnStatement>
         ");
 }