private AsmDsInstruction MakeTarget(Int32 wordCountValue) { AsmDsInstruction target = new AsmDsInstruction(); target.SetWordCountValueForUnitTest(wordCountValue); return(target); }
private void CheckGetCodeWordCount(Int32 wordCountValue, String message) { AsmDsInstruction target = MakeTarget(wordCountValue); Int32 actual = target.GetCodeWordCount(); Int32 expected = wordCountValue; Assert.AreEqual(expected, actual, message); }
private void CheckGenerateCode(Int32 wordCountValue, String message) { AsmDsInstruction target = MakeTarget(wordCountValue); const Label DefinedLabel = null; RelocatableModule relModule = new RelocatableModule(); target.GenerateCode(DefinedLabel, relModule); // 確保する語数分の 0 の語が追加される。 Word[] expectedWords = WordTest.MakeCountArray(Word.Zero, wordCountValue); RelocatableModuleTest.CheckWords(relModule, expectedWords, message); }
private void CheckReadOperand( String text, Boolean success, Int32 expectedValue, String message) { AsmDsInstruction target = new AsmDsInstruction(); ProgramInstructionTest.CheckReadOperand(target, text, success, message); if (success) { WordCount expected = WordCount.MakeForUnitTest(expectedValue); WordCount actual = target.WordCount; WordCountTest.Check(expected, actual, message); } }