public void DiffLocalItem()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.That(CommandTester.TestExecution(AnkhCommand.DiffLocalItem), Is.False);
            }
        }
        public void ViewInWindowsCommand()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.That(CommandTester.TestExecution(AnkhCommand.ViewInWindows), Is.False);
            }
        }
        public void UpdateItemCommand()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.That(CommandTester.TestExecution(AnkhCommand.UpdateItemSpecific), Is.False);
            }
        }
        public void AddItem()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.IsFalse(CommandTester.TestExecution(AnkhCommand.AddItem), "Add disabled with empty selection");
            }
        }
        public void RemoveWorkingCopyRoot()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.That(CommandTester.TestExecution(AnkhCommand.RemoveWorkingCopyExplorerRoot), Is.False);
            }
        }
        public void MakeDirectoryCommand()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.That(CommandTester.TestExecution(AnkhCommand.NewFolder), Is.False);
            }
        }
        public void CopyReposExplorerUrl()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.That(CommandTester.TestExecution(AnkhCommand.CopyReposExplorerUrl), Is.False);
            }
        }
        public void AddWorkingCopyExplorerRootCommandWithPath()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.IsTrue(CommandTester.TestExecution(AnkhCommand.WorkingCopyBrowse, Path.GetTempPath()));
            }
        }
        public void RevertItemCommand()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.That(CommandTester.TestExecution(AnkhCommand.RevertItem), Is.False,
                            "Cannot revert empty selection");
            }
        }
        public void Refresh()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.That(CommandTester.TestExecution(AnkhCommand.Refresh), Is.True,
                            "Refresh works with empty selection");
            }
        }
        public void CommitItemCommand()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.That(CommandTester.TestExecution(AnkhCommand.CommitItem), Is.False,
                            "Commit doesn't run without selection");
            }
        }
        public void CheckoutCommand()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.That(CommandTester.TestExecution(AnkhCommand.Checkout), Is.False,
                            "Checkout doesn't execute with empty selection");
            }
        }
        public void BlameCommand()
        {
            ISelectionContext selC = SelectionContextMock.EmptyContext();

            using (ServiceProviderHelper.AddService(typeof(ISelectionContext), selC))
            {
                Assert.That(CommandTester.TestExecution(AnkhCommand.ItemAnnotate), Is.False,
                            "Blame with empty selection doesn't execute");
            }
        }
        public void ShowWorkingCopyExplorer()
        {
            //IAnkhPackage package = mocks.CreateMock<IAnkhPackage>();
            //using (mocks.Record())
            //{
            //    package.ShowToolWindow(AnkhToolWindow.WorkingCopyExplorer);
            //    LastCall.Repeat.Once();
            //}

            //using (mocks.Playback())
            //{
            CommandTester.TestExecution(AnkhCommand.ShowWorkingCopyExplorer);
            //}
        }
        public void ShowCommitDialog()
        {
            var state = new Mock <IAnkhCommandStates>();

            state.SetupGet(x => x.SccProviderActive).Returns(true);

            var uiShell = new Mock <SVsUIShell>().As <IVsUIShell>();

            using (ServiceProviderHelper.AddService(typeof(SVsUIShell), uiShell.Object))
                using (ServiceProviderHelper.AddService(typeof(IAnkhCommandStates), state.Object))
                {
                    Assert.That(CommandTester.TestExecution(AnkhCommand.ShowPendingChanges), Is.True);
                }
        }
 public void AddRepositoryRoot()
 {
     Assert.IsTrue(CommandTester.TestExecution(AnkhCommand.RepositoryBrowse), "Add repository root always enabled");
 }
 public void AddWorkingCopyExplorerRootCommand()
 {
     CommandTester.TestExecution(AnkhCommand.WorkingCopyBrowse);
 }