public void TestOnUpdateProjDirNull() { var projMapper = new Mock <IProjectFileMapper>(); var projInfo = new Mock <ISccProjectInfo>(); projInfo.SetupGet(x => x.ProjectDirectory).Returns((string)null); projMapper.Setup(x => x.GetProjectInfo(It.IsAny <SccProject>())).Returns(projInfo.Object); sp.AddService(typeof(IProjectFileMapper), projMapper.Object); // The sln projectroot also returns null var slnSettings = new Mock <IAnkhSolutionSettings>(); slnSettings.SetupGet(x => x.ProjectRoot).Returns((string)null); sp.AddService(typeof(IAnkhSolutionSettings), slnSettings.Object); TestAllCommands(); }
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 SccProject("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>(); }
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>(); }