Beispiel #1
0
        public void BrowseDiff_DifftoolMenu_Tracked(bool t)
        {
            var rev           = new GitRevision(ObjectId.Random());
            var selectionInfo = new ContextMenuSelectionInfo(rev, isAnyTracked: t);

            _controller.ShouldShowDifftoolMenus(selectionInfo).Should().Be(t);
        }
        public void BrowseDiff_ResetMenu_BareRepo(bool t)
        {
            var rev           = new GitRevision(null);
            var selectionInfo = new ContextMenuSelectionInfo(rev, isBareRepository: t);

            _controller.ShouldShowResetFileMenus(selectionInfo).Should().Be(!t);
        }
        public void BrowseDiff_ResetMenu_Tracked(bool t)
        {
            var rev           = new GitRevision(null);
            var selectionInfo = new ContextMenuSelectionInfo(rev, isAnyTracked: t);

            _controller.ShouldShowResetFileMenus(selectionInfo).Should().Be(t);
        }
        public void BrowseDiff_DifftoolMenu_Selected(bool t)
        {
            var rev           = new GitRevision(null);
            var selectionInfo = new ContextMenuSelectionInfo(rev, isAnyItemSelected: t);

            _controller.ShouldShowDifftoolMenus(selectionInfo).Should().Be(t);
        }
Beispiel #5
0
        public void BrowseDiff_DifftoolMenu_BareRepo(bool t)
        {
            var rev           = new GitRevision(ObjectId.Random());
            var selectionInfo = new ContextMenuSelectionInfo(rev, isBareRepository: t);

            _controller.ShouldShowDifftoolMenus(selectionInfo).Should().BeTrue();
        }
        public void BrowseDiff_StageMenus_Index(bool t)
        {
            var rev           = new GitRevision(GitRevision.UnstagedGuid);
            var selectionInfo = new ContextMenuSelectionInfo(rev, isAnyItemUnstaged: t);

            _controller.ShouldShowMenuStage(selectionInfo).Should().Be(t);
        }
Beispiel #7
0
        public void BrowseDiff_ResetMenu_Selected(bool t)
        {
            var rev           = new GitRevision(ObjectId.Random());
            var selectionInfo = new ContextMenuSelectionInfo(rev, isAnyItemSelected: t);

            _controller.ShouldShowResetFileMenus(selectionInfo).Should().Be(t);
        }
Beispiel #8
0
        public void BrowseDiff_DeleteFile_Index()
        {
            var rev           = new GitRevision(ObjectId.IndexId);
            var selectionInfo = new ContextMenuSelectionInfo(rev);

            _controller.ShouldShowMenuDeleteFile(selectionInfo).Should().BeTrue();
        }
Beispiel #9
0
        public void BrowseDiff_OpenRevisionFile_WorkTree()
        {
            var rev           = new GitRevision(ObjectId.WorkTreeId);
            var selectionInfo = new ContextMenuSelectionInfo(rev);

            _controller.ShouldShowMenuOpenRevision(selectionInfo).Should().BeFalse();
        }
Beispiel #10
0
        public void BrowseDiff_StageMenus_Index(bool t)
        {
            var rev           = new GitRevision(ObjectId.WorkTreeId);
            var selectionInfo = new ContextMenuSelectionInfo(rev, isAnyItemWorkTree: t);

            _controller.ShouldShowMenuStage(selectionInfo).Should().Be(t);
        }
Beispiel #11
0
        public void BrowseDiff_ResetMenu_Selected(int t)
        {
            var rev           = new GitRevision(ObjectId.Random());
            var selectionInfo = new ContextMenuSelectionInfo(rev, selectedGitItemCount: t);

            _controller.ShouldShowResetFileMenus(selectionInfo).Should().Be(t != 0);
        }
Beispiel #12
0
        public void BrowseDiff_EditOpen_IsAnySubmodule(bool t)
        {
            var rev           = new GitRevision(ObjectId.Random());
            var selectionInfo = new ContextMenuSelectionInfo(selectedRevision: rev, isAnySubmodule: t);

            _controller.ShouldShowMenuOpenRevision(selectionInfo).Should().Be(!t);
        }
        public void BrowseDiff_StageMenus_Unstaged(bool t)
        {
            var rev           = new GitRevision(GitRevision.UnstagedGuid);
            var selectionInfo = new ContextMenuSelectionInfo(rev, firstIsParent: t);

            _controller.ShouldShowMenuStage(selectionInfo).Should().Be(t);
            _controller.ShouldShowMenuUnstage(selectionInfo).Should().BeFalse();
        }
        public void BrowseDiff_MainMenus_SingleSelected(bool t)
        {
            var rev           = new GitRevision("1234567890");
            var selectionInfo = new ContextMenuSelectionInfo(selectedRevision: rev, isSingleGitItemSelected: t);

            _controller.ShouldShowMenuSaveAs(selectionInfo).Should().Be(t);
            _controller.ShouldShowMenuCherryPick(selectionInfo).Should().Be(t);
            _controller.ShouldShowMenuStage(selectionInfo).Should().BeFalse();
            _controller.ShouldShowMenuUnstage(selectionInfo).Should().BeFalse();
            _controller.ShouldShowSubmoduleMenus(selectionInfo).Should().BeFalse();
            _controller.ShouldShowMenuEditFile(selectionInfo).Should().Be(t);
            _controller.ShouldShowMenuCopyFileName(selectionInfo).Should().BeTrue();
            _controller.ShouldShowMenuShowInFileTree(selectionInfo).Should().Be(t);
            _controller.ShouldShowMenuFileHistory(selectionInfo).Should().Be(t);
            _controller.ShouldShowMenuBlame(selectionInfo).Should().Be(t);
        }
Beispiel #15
0
        public void BrowseDiff_MainMenus_Default()
        {
            var rev           = new GitRevision(ObjectId.Random());
            var selectionInfo = new ContextMenuSelectionInfo(selectedRevision: rev);

            _controller.ShouldShowMenuSaveAs(selectionInfo).Should().BeTrue();
            _controller.ShouldShowMenuCherryPick(selectionInfo).Should().BeTrue();
            _controller.ShouldShowMenuStage(selectionInfo).Should().BeFalse();
            _controller.ShouldShowMenuUnstage(selectionInfo).Should().BeFalse();
            _controller.ShouldShowSubmoduleMenus(selectionInfo).Should().BeFalse();
            _controller.ShouldShowMenuEditFile(selectionInfo).Should().BeTrue();
            _controller.ShouldShowMenuCopyFileName(selectionInfo).Should().BeTrue();
            _controller.ShouldShowMenuShowInFileTree(selectionInfo).Should().BeTrue();
            _controller.ShouldShowMenuFileHistory(selectionInfo).Should().BeTrue();
            _controller.ShouldShowMenuBlame(selectionInfo).Should().BeTrue();
        }
Beispiel #16
0
        public void BrowseDiff_MainMenus_SingleSelected(int t)
        {
            var rev           = new GitRevision(ObjectId.Random());
            var selectionInfo = new ContextMenuSelectionInfo(selectedRevision: rev, selectedGitItemCount: t);

            _controller.ShouldShowMenuSaveAs(selectionInfo).Should().Be(t != 0);
            _controller.ShouldShowMenuCherryPick(selectionInfo).Should().Be(t != 0);
            _controller.ShouldShowMenuStage(selectionInfo).Should().BeFalse();
            _controller.ShouldShowMenuUnstage(selectionInfo).Should().BeFalse();
            _controller.ShouldShowSubmoduleMenus(selectionInfo).Should().BeFalse();
            _controller.ShouldShowMenuEditWorkingDirectoryFile(selectionInfo).Should().Be(t != 0);
            _controller.ShouldShowMenuOpenRevision(selectionInfo).Should().Be(t != 0);
            _controller.ShouldShowMenuDeleteFile(selectionInfo).Should().BeFalse();
            _controller.ShouldShowMenuCopyFileName(selectionInfo).Should().Be(t != 0);
            _controller.ShouldShowMenuShowInFileTree(selectionInfo).Should().Be(t != 0);
            _controller.ShouldShowMenuFileHistory(selectionInfo).Should().Be(t != 0);
            _controller.ShouldShowMenuBlame(selectionInfo).Should().Be(t != 0);
        }
        public void BrowseDiff_ResetMenu_Default()
        {
            var selectionInfo = new ContextMenuSelectionInfo();

            _controller.ShouldShowResetFileMenus(selectionInfo).Should().BeTrue();
        }