예제 #1
0
        public void SetSite()
        {
            // Create the package
            IVsPackage package = new AnkhSvnPackage() as IVsPackage;
            Assert.IsNotNull(package, "The object does not implement IVsPackage");

            var statusCache = new Mock<IFileStatusCache>();
            var regEditors = new Mock<SVsRegisterEditors>().As<IVsRegisterEditors>();

            var vsShell = new Mock<SVsShell>().As<IVsShell>();
            object r = @"SOFTWARE\Microsoft\VisualStudio\8.0";
            vsShell.Setup(x => x.GetProperty((int)__VSSPROPID.VSSPROPID_VirtualRegistryRoot, out r)).Returns(VSConstants.S_OK);

            var vsTextMgr = new Mock<SVsTextManager>().As<IVsTextManager>();

            var monitorSelection = new Mock<IVsMonitorSelection>();

            var olMgr = new Mock<SOleComponentManager>().As<IOleComponentManager>();

            var outputWindow = new Mock<SVsOutputWindow>().As<IVsOutputWindow>();

            using (ServiceProviderHelper.AddService(typeof(SVsOutputWindow), outputWindow.Object))
            using (ServiceProviderHelper.AddService(typeof(SOleComponentManager), olMgr.Object))
            using (ServiceProviderHelper.AddService(typeof(IVsMonitorSelection), monitorSelection.Object))
            using (ServiceProviderHelper.AddService(typeof(SVsTextManager), vsTextMgr.Object))
            using (ServiceProviderHelper.AddService(typeof(SVsShell), vsShell.Object))
            using (ServiceProviderHelper.AddService(typeof(SVsRegisterEditors), regEditors.Object))
            using (ServiceProviderHelper.AddService(typeof(IFileStatusCache), statusCache.Object))
            using (ServiceProviderHelper.SetSite(package))
            {
                // Unsite the package
                Assert.AreEqual(0, package.SetSite(null), "SetSite(null) did not return S_OK");
            }
        }
예제 #2
0
 public AnkhDynamicEditorFactory(AnkhSvnPackage package)
     : base(package)
 {
 }
예제 #3
0
 public AnkhDiffEditorFactory(AnkhSvnPackage package)
     : base(package)
 {
 }
예제 #4
0
        public void SetUp()
        {
            // Create the package
            package = new AnkhSvnPackage();

            var statusCache = new Mock<IFileStatusCache>();
            var regEditors = new Mock<SVsRegisterEditors>().As<IVsRegisterEditors>();

            var vsShell = new Mock<SVsShell>().As<IVsShell>();
            object r = @"SOFTWARE\Microsoft\VisualStudio\8.0";
            vsShell.Setup(x => x.GetProperty((int)__VSSPROPID.VSSPROPID_VirtualRegistryRoot, out r)).Returns(VSConstants.S_OK);

            var vsTextMgr = new Mock<SVsTextManager>().As<IVsTextManager>();

            var monitorSelection = new Mock<IVsMonitorSelection>();

            var olMgr = new Mock<SOleComponentManager>().As<IOleComponentManager>();

            var outputWindow = new Mock<SVsOutputWindow>().As<IVsOutputWindow>();

            ServiceProviderHelper.AddService(typeof(IAnkhPackage), package);
            ServiceProviderHelper.AddService(typeof(SVsOutputWindow), outputWindow.Object);
            ServiceProviderHelper.AddService(typeof(SOleComponentManager), olMgr.Object);
            ServiceProviderHelper.AddService(typeof(IVsMonitorSelection), monitorSelection.Object);
            ServiceProviderHelper.AddService(typeof(SVsTextManager), vsTextMgr.Object);
            ServiceProviderHelper.AddService(typeof(SVsShell), vsShell.Object);
            ServiceProviderHelper.AddService(typeof(SVsRegisterEditors), regEditors.Object);
            ServiceProviderHelper.AddService(typeof(IFileStatusCache), statusCache.Object);

            var uiService = new Mock<IUIService>();
            uiService.Setup(x => x.ShowDialog(It.IsAny<Form>())).Returns(DialogResult.OK);

            ServiceProviderHelper.AddService(typeof(IUIService), uiService.Object);
        }
예제 #5
0
 public void IsIVsPackage()
 {
     AnkhSvnPackage package = new AnkhSvnPackage();
     Assert.IsNotNull(package as IVsPackage, "The object does not implement IVsPackage");
 }
예제 #6
0
 public void CreateInstance()
 {
     AnkhSvnPackage package = new AnkhSvnPackage();
 }
예제 #7
0
 public AnkhDynamicEditorFactory(AnkhSvnPackage package)
     : base(package)
 {
 }