public void Setup() { mr = new MockRepository(); form = new MainForm(); sc = new ServiceContainer(); loader = mr.StrictMock<ILoader>(); dec = mr.StrictMock<IDecompiler>(); sc = new ServiceContainer(); uiSvc = new FakeShellUiService(); host = mr.StrictMock<DecompilerHost>(); memSvc = mr.StrictMock<ILowLevelViewService>(); var image = new LoadedImage(Address.Ptr32(0x10000), new byte[1000]); var imageMap = image.CreateImageMap(); var arch = mr.StrictMock<IProcessorArchitecture>(); arch.Stub(a => a.CreateRegisterBitset()).Return(new BitSet(32)); arch.Replay(); var platform = mr.StrictMock<Platform>(null, arch); arch.BackToRecord(); program = new Program(image, imageMap, arch, platform); project = new Project { Programs = { program } }; browserSvc = mr.StrictMock<IProjectBrowserService>(); sc.AddService<IDecompilerUIService>(uiSvc); sc.AddService(typeof(IDecompilerShellUiService), uiSvc); sc.AddService(typeof(IDecompilerService), new DecompilerService()); sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService()); sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener()); sc.AddService(typeof(IProjectBrowserService), browserSvc); sc.AddService(typeof(ILowLevelViewService), memSvc); sc.AddService<ILoader>(loader); i = new TestInitialPageInteractor(sc, dec); }
public void Setup() { mr = new MockRepository(); form = new MainForm(); sc = new ServiceContainer(); loader = mr.StrictMock<ILoader>(); dec = mr.StrictMock<IDecompiler>(); sc = new ServiceContainer(); uiSvc = new FakeShellUiService(); host = mr.StrictMock<DecompilerHost>(); memSvc = mr.StrictMock<ILowLevelViewService>(); var mem = new MemoryArea(Address.Ptr32(0x10000), new byte[1000]); var imageMap = new SegmentMap( mem.BaseAddress, new ImageSegment("code", mem, AccessMode.ReadWriteExecute)); var arch = mr.StrictMock<IProcessorArchitecture>(); var platform = mr.StrictMock<IPlatform>(); program = new Program(imageMap, arch, platform); project = new Project { Programs = { program } }; browserSvc = mr.StrictMock<IProjectBrowserService>(); sc.AddService<IDecompilerUIService>(uiSvc); sc.AddService(typeof(IDecompilerShellUiService), uiSvc); sc.AddService(typeof(IDecompilerService), new DecompilerService()); sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService()); sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener()); sc.AddService(typeof(IProjectBrowserService), browserSvc); sc.AddService(typeof(ILowLevelViewService), memSvc); sc.AddService<ILoader>(loader); sc.AddService<DecompilerHost>(host); i = new TestInitialPageInteractor(sc, dec); }
protected override IDecompilerUIService CreateUIService(System.Windows.Forms.Form dlg, System.Windows.Forms.OpenFileDialog ofd, System.Windows.Forms.SaveFileDialog sfd) { FakeUiService = new FakeUiService(); return FakeUiService; }