Exemplo n.º 1
0
        public void MainForm_ViewMemoryWindow()
        {
            Given_MainFormInteractor();
            var disasmSvc = mr.StrictMock <IDisassemblyViewService>();

            Given_UiSvc_IgnoresCommands();
            svcFactory.Stub(s => s.CreateDisassemblyViewService()).Return(disasmSvc);       //$REVIEW: this shouldn't be necessary -- only if user explicitly asks for it.
            memSvc.Expect(x => x.ShowWindow());
            memSvc.Expect(m => m.ViewImage(Arg <Program> .Is.NotNull));
            Given_DecompilerInstance();
            mr.ReplayAll();

            When_MainFormInteractorWithLoader();
            interactor.Execute(new CommandID(CmdSets.GuidReko, CmdIds.ViewMemory));

            mr.VerifyAll();
        }
Exemplo n.º 2
0
        public void LpiMarkingProceduresShouldAddToUserProceduresList()
        {
            var disSvc = AddService <IDisassemblyViewService>();

            Assert.AreEqual(0, decSvc.Decompiler.Project.Programs[0].UserProcedures.Count);
            var addr = Address.SegPtr(0x0C20, 0);

            memSvc.Expect(s => s.GetSelectedAddressRange()).Return(new AddressRange(addr, addr));
            memSvc.Expect(s => s.InvalidateWindow()).IgnoreArguments();
            mr.ReplayAll();

            //interactor.MarkAndScanProcedure(prog);

            mr.VerifyAll();
            //$REVIEW: Need to pass InputFile into the SelectedProcedureEntry piece.
            var program = decSvc.Decompiler.Project.Programs[0];

            Assert.AreEqual(1, program.UserProcedures.Count);
            Procedure_v1 uproc = (Procedure_v1)program.UserProcedures.Values[0];

            Assert.AreEqual("0C20:0000", uproc.Address);
        }