public void Setup() { mr = new MockRepository(); sp = new ServiceContainer(); uiSvc = mr.StrictMock <IDecompilerShellUiService>(); uiPrefsSvc = mr.StrictMock <IUiPreferencesService>(); dlgFactory = mr.StrictMock <IDialogFactory>(); uiSvc.Stub(u => u.SetContextMenu(null, 0)).IgnoreArguments(); uiSvc.Replay(); uiPrefsSvc.Stub(u => u.Styles).Return(new Dictionary <string, UiStyle>()); uiPrefsSvc.Replay(); sp.AddService(typeof(IDecompilerShellUiService), uiSvc); sp.AddService(typeof(IDialogFactory), dlgFactory); sp.AddService(typeof(IUiPreferencesService), uiPrefsSvc); addrBase = Address.Ptr32(0x1000); }
public void Setup() { mr = new MockRepository(); sp = new ServiceContainer(); uiSvc = mr.StrictMock <IDecompilerShellUiService>(); uiPrefsSvc = mr.StrictMock <IUiPreferencesService>(); dlgFactory = mr.StrictMock <IDialogFactory>(); uiSvc.Stub(u => u.GetContextMenu(MenuIds.CtxMemoryControl)).Return(new ContextMenu()); uiSvc.Stub(u => u.GetContextMenu(MenuIds.CtxDisassembler)).Return(new ContextMenu()); uiSvc.Replay(); uiPrefsSvc.Stub(u => u.Styles).Return(new Dictionary <string, UiStyle>()); uiPrefsSvc.Replay(); sp.AddService(typeof(IDecompilerShellUiService), uiSvc); sp.AddService(typeof(IDialogFactory), dlgFactory); sp.AddService(typeof(IUiPreferencesService), uiPrefsSvc); addrBase = Address.Ptr32(0x1000); }
public void Setup() { mr = new MockRepository(); sp = new ServiceContainer(); uiSvc = mr.StrictMock<IDecompilerShellUiService>(); uiPrefsSvc = mr.StrictMock<IUiPreferencesService>(); dlgFactory = mr.StrictMock<IDialogFactory>(); uiSvc.Stub(u => u.GetContextMenu(MenuIds.CtxMemoryControl)).Return(new ContextMenu()); uiSvc.Stub(u => u.GetContextMenu(MenuIds.CtxDisassembler)).Return(new ContextMenu()); uiSvc.Replay(); uiPrefsSvc.Stub(u => u.Styles).Return(new Dictionary<string, UiStyle>()); uiPrefsSvc.Replay(); sp.AddService(typeof(IDecompilerShellUiService), uiSvc); sp.AddService(typeof(IDialogFactory), dlgFactory); sp.AddService(typeof(IUiPreferencesService), uiPrefsSvc); addrBase = Address.Ptr32(0x1000); }
public void Setup() { mr = new MockRepository(); program = new Program(); codeViewer = new CodeViewerPane(); decompilerSvc = mr.Stub <IDecompilerService>(); decompiler = mr.Stub <IDecompiler>(); uiPreferencesSvc = mr.Stub <IUiPreferencesService>(); uiSvc = mr.Stub <IDecompilerShellUiService>(); frame = mr.Stub <IWindowFrame>(); font = new Font("Arial", 10); var styles = new Dictionary <string, UiStyle>(); uiPreferencesSvc.Stub(u => u.Styles).Return(styles); var sc = new ServiceContainer(); decompilerSvc.Decompiler = decompiler; sc.AddService <IDecompilerService>(decompilerSvc); sc.AddService <IUiPreferencesService>(uiPreferencesSvc); sc.AddService <IDecompilerShellUiService>(uiSvc); codeViewer.SetSite(sc); }
public void Setup() { mr = new MockRepository(); mockFactory = new MockFactory(mr); var platform = mockFactory.CreatePlatform(); ; program = new Program { Architecture = platform.Architecture, Platform = platform, }; codeViewer = new CodeViewerPane(); decompilerSvc = mr.Stub<IDecompilerService>(); decompiler = mr.Stub<IDecompiler>(); uiPreferencesSvc = mr.Stub<IUiPreferencesService>(); uiSvc = mr.Stub<IDecompilerShellUiService>(); frame = mr.Stub<IWindowFrame>(); font = new Font("Arial", 10); var styles = new Dictionary<string, UiStyle>() { { UiStyles.CodeWindow, new UiStyle { Background = new SolidBrush(Color.White), } } }; uiPreferencesSvc.Stub(u => u.Styles).Return(styles); var sc = new ServiceContainer(); decompilerSvc.Decompiler = decompiler; sc.AddService<IDecompilerService>(decompilerSvc); sc.AddService<IUiPreferencesService>(uiPreferencesSvc); sc.AddService<IDecompilerShellUiService>(uiSvc); codeViewer.SetSite(sc); }
private void Expect_UiPreferences_Loaded() { uiPrefs.Expect(u => u.Load()); uiPrefs.Stub(u => u.WindowState).Return(FormWindowState.Normal); uiPrefs.Stub(u => u.WindowSize).Return(new Size(1000, 700)); }
public void Setup() { mr = new MockRepository(); codeViewer = new CodeViewerPane(); decompilerSvc = mr.Stub<IDecompilerService>(); decompiler = mr.Stub<IDecompiler>(); uiPreferencesSvc = mr.Stub<IUiPreferencesService>(); uiSvc = mr.Stub<IDecompilerShellUiService>(); font = new Font("Arial", 10); var styles = new Dictionary<string, UiStyle>(); uiPreferencesSvc.Stub(u => u.Styles).Return(styles); var sc = new ServiceContainer(); decompilerSvc.Decompiler = decompiler; sc.AddService<IDecompilerService>(decompilerSvc); sc.AddService<IUiPreferencesService>(uiPreferencesSvc); sc.AddService<IDecompilerShellUiService>(uiSvc); codeViewer.SetSite(sc); }