示例#1
0
        public void Cvp_SetProcedure()
        {
            codeViewer.CreateControl();
            var m = new ProcedureBuilder();

            m.Return();

            using (mr.Record())
            {
                var project = new Project {
                    Programs = { new Program() }
                };
                decompiler.Stub(d => d.Project).Return(project);
                uiPreferencesSvc.SourceCodeFont = font;
            }

            codeViewer.DisplayProcedure(m.Procedure);

            string sExp =
                "void ProcedureBuilder()" + nl +
                "{" + nl +
                "ProcedureBuilder_entry:" + nl +
                "l1:" + nl +
                "    'return'" + nl +
                "ProcedureBuilder_exit:" + nl +
                "}" + nl;

            Assert.AreEqual(sExp, Flatten(codeViewer.TextView.Model));
        }
示例#2
0
        public void Cvp_SetProcedure()
        {
            Given_Codeviewer();
            Given_StubProcedure();
            Given_Program();
            mr.ReplayAll();

            codeViewer.DisplayProcedure(this.program, this.proc);

            string sExp =
                "void fnTest()" + nl +
                "{" + nl +
                "fnTest_entry:" + nl +
                "l1:" + nl +
                "    'return'" + nl +
                "fnTest_exit:" + nl +
                "}" + nl;

            Assert.AreEqual(sExp, Flatten(codeViewer.TextView.Model));
        }