Пример #1
0
        public void Mfi_FinishDecompilation()
        {
            Given_MainFormInteractor();
            Given_LoadPreferences();
            Given_DecompilerInstance();
            Given_XmlWriter();
            Given_SavePrompt(false);
            //dcSvc.Setup(d => d.Decompiler = null).IgnoreArguments();
            decompiler.Setup(d => d.AnalyzeDataFlow());
            decompiler.Setup(d => d.ReconstructTypes());
            decompiler.Setup(d => d.StructureProgram());
            fsSvc.Setup(f => f.MakeRelativePath("foo.dcproject", "foo.exe")).Returns("foo.exe");
            brSvc.Setup(b => b.Reload())
            .Verifiable();

            When_CreateMainFormInteractor();
            interactor.OpenBinary("foo.exe");

            Assert.AreSame(interactor.InitialPageInteractor, interactor.CurrentPhase);
            interactor.FinishDecompilation();
            Assert.AreSame(interactor.FinalPageInteractor, interactor.CurrentPhase);
            brSvc.Verify();
        }
Пример #2
0
        public void Mfi_FinishDecompilation()
        {
            Given_MainFormInteractor();
            Given_LoadPreferences();
            Given_DecompilerInstance();
            Given_XmlWriter();
            Given_SavePrompt(true);
            dcSvc.Stub(d => d.Decompiler = null);
            fsSvc.Stub(f => f.MakeRelativePath("foo.dcproject", "foo.exe")).Return("foo.exe");
            brSvc.Expect(b => b.Reload());
            mr.ReplayAll();

            When_CreateMainFormInteractor();
            interactor.OpenBinary(null);
            Assert.AreSame(interactor.InitialPageInteractor, interactor.CurrentPhase);
            interactor.FinishDecompilation();
            Assert.AreSame(interactor.FinalPageInteractor, interactor.CurrentPhase);

            mr.VerifyAll();
        }