示例#1
0
        public void Mfi_NextPhase_AdvanceToNextInteractor()
        {
            Given_Loader();
            Given_MainFormInteractor();
            diagnosticSvc.Setup(d => d.ClearDiagnostics()).Verifiable();
            brSvc.Setup(b => b.Clear());
            Given_LoadPreferences();
            Given_DecompilerInstance();
            Given_XmlWriter();
            Given_SavePrompt(true);
            //dcSvc.Setup(d => d.Decompiler = null);
            uiSvc.Setup(u => u.DocumentWindows).Returns(new List <IWindowFrame>());
            fsSvc.Setup(f => f.MakeRelativePath("foo.dcproject", "foo.exe")).Returns("foo.exe");
            fsSvc.Setup(f => f.MakeRelativePath("foo.dcproject", null)).Returns((string)null);
            uiSvc.Setup(u => u.ShowSaveFileDialog("foo.dcproject")).Returns("foo.dcproject");

            When_CreateMainFormInteractor();
            interactor.OpenBinary(null);
            Assert.AreSame(interactor.InitialPageInteractor, interactor.CurrentPhase);
            interactor.NextPhase();
            Assert.AreSame(interactor.ScannedPageInteractor, interactor.CurrentPhase);

            form.Verify();
            diagnosticSvc.Verify();
        }
        public void Mfi_NextPhase_AdvanceToNextInteractor()
        {
            Given_Loader();
            Given_MainFormInteractor();
            diagnosticSvc.Expect(d => d.ClearDiagnostics());
            brSvc.Stub(b => b.Clear());
            Given_LoadPreferences();
            Given_DecompilerInstance();
            Given_XmlWriter();
            Given_SavePrompt(true);
            dcSvc.Stub(d => d.Decompiler = null);
            uiSvc.Stub(u => u.DocumentWindows).Return(new List <IWindowFrame>());
            fsSvc.Stub(f => f.MakeRelativePath("foo.dcproject", "foo.exe")).Return("foo.exe");
            fsSvc.Stub(f => f.MakeRelativePath(Arg <string> .Is.Equal("foo.dcproject"), Arg <string> .Is.Null)).Return(null);
            uiSvc.Stub(u => u.ShowSaveFileDialog("foo.dcproject")).Return("foo.dcproject");
            mr.ReplayAll();

            When_CreateMainFormInteractor();
            interactor.OpenBinary(null);
            Assert.AreSame(interactor.InitialPageInteractor, interactor.CurrentPhase);
            interactor.NextPhase();
            Assert.AreSame(interactor.ScannedPageInteractor, interactor.CurrentPhase);

            mr.VerifyAll();
        }