public CommandMapperSite(CommandMapper context) : base(context) { _mapper = context; }
public void SetUp() { sp = new AnkhServiceProvider(); object pvar; var shell = new Mock<SVsShell>().As<IVsShell>(); shell.Setup(x => x.GetProperty(It.IsAny<int>(), out pvar)).Returns(-1); sp.AddService(typeof(SVsShell), shell.Object); var state = new Mock<IAnkhCommandStates>(); state.SetupGet(x => x.SccProviderActive).Returns(true); state.SetupGet(x => x.SolutionExists).Returns(true); sp.AddService(typeof(IAnkhCommandStates), state.Object); var selection = new Mock<ISelectionContext>(); selection.Setup(x => x.Cache[It.IsAny<object>()]).Returns(null); var rawHandle = new Mock<IVsSccProject2>(); var p = new SvnProject("c:\foo\bar", rawHandle.Object); selection.Setup(x => x.GetSelectedProjects(It.IsAny<bool>())).Returns(new[] { p }); sp.AddService(typeof(ISelectionContext), selection.Object); var pcMgr = new Mock<IPendingChangesManager>(); sp.AddService(typeof(IPendingChangesManager), pcMgr.Object); var textMgr = new Mock<SVsTextManager>().As<IVsTextManager>(); sp.AddService(typeof(SVsTextManager), textMgr.Object); var selectionMonitor = new Mock<IVsMonitorSelection>(); sp.AddService(typeof(IVsMonitorSelection), selectionMonitor.Object); var r = new AnkhRuntime(sp); r.AddModule(new AnkhModule(r)); r.AddModule(new AnkhSccModule(r)); //r.AddModule(new AnkhVSModule(r)); r.AddModule(new AnkhUIModule(r)); r.AddModule(new AnkhDiffModule(r)); r.Start(); cm = r.GetService<CommandMapper>(); }