コード例 #1
0
        public void AddOrRemoveDirectoryAccordingToIsSelected_Add_DirectoryVMIsInListSelectedDirectories()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            DirectorySelectionHandler       directorySelectionHandler       = new DirectorySelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DirectoryItemViewModel          directoryItemVM = new DirectoryItemViewModel();

            directorySelectionHandler.AddOrRemoveDirectoryAccordingToIsSelected(true, directoryItemVM);

            Assert.AreEqual(directoryItemVM, selectedExplorerTreeItemHandler.SelectedDirectories.First());
        }
コード例 #2
0
        public void MultiselectDesicions_IsEnsuredOnlyDirectoriesAreNowSelectableByMultiselectTrue_ReturnsTrue()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            DirectorySelectionHandler       directorySelectionHandler       = new DirectorySelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DirectoryItemViewModel          directoryItemVM = new DirectoryItemViewModel();

            bool result = directorySelectionHandler.MultiselectDesicions(true, directoryItemVM);

            Assert.AreEqual(true, result);
        }
コード例 #3
0
        public void MultiselectDesicions_IsEnsuredOnlyDirectoriesAreNowSelectableByMultiselectTrue_DirectoryVMIsInListSelectedDirectories()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            DirectorySelectionHandler       directorySelectionHandler       = new DirectorySelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DirectoryItemViewModel          directoryItemVM = new DirectoryItemViewModel();

            directorySelectionHandler.MultiselectDesicions(true, directoryItemVM);

            Assert.AreEqual(directoryItemVM, selectedExplorerTreeItemHandler.SelectedDirectories.First());
        }
コード例 #4
0
        public void MultiselectDesicions_IsEnsuredOnlyDirectoriesAreNowSelectableByMultiselectFalseBecauseFileWasSelectedFirst_ReturnsFalse()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);

            selectedExplorerTreeItemHandler.SelectedFiles.Add(new FileItemViewModel());
            DirectorySelectionHandler directorySelectionHandler = new DirectorySelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DirectoryItemViewModel    directoryItemVM           = new DirectoryItemViewModel();

            bool result = directorySelectionHandler.MultiselectDesicions(true, directoryItemVM);

            Assert.AreEqual(false, result);
        }
コード例 #5
0
        public void MultiselectDesicions__IsMultiselectCombinationDirectoriesAndFilesAllowedTrue_AndIsEnsuredOnlyDirectoriesAndFilesAreNowSelectableByMultiselectTrue__DirectoryVMIsInListSelectedDirectories()
        {
            SelectionConfiguration selectionConfiguration = new SelectionConfiguration();

            selectionConfiguration.IsMultiselectCombinationDirectoriesAndFilesAllowed = true;

            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            DirectorySelectionHandler       directorySelectionHandler       = new DirectorySelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DirectoryItemViewModel          directoryItemVM = new DirectoryItemViewModel();


            bool result = directorySelectionHandler.MultiselectDesicions(true, directoryItemVM);

            Assert.AreEqual(directoryItemVM, selectedExplorerTreeItemHandler.SelectedDirectories.First());
        }
コード例 #6
0
        public void MultiselectDesicions_IsMultiselectCombinationAllTypesAllowedTrue_ReturnsTrue()
        {
            SelectionConfiguration selectionConfiguration = new SelectionConfiguration();

            selectionConfiguration.IsMultiselectCombinationAllTypesAllowed = true;

            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            DirectorySelectionHandler       directorySelectionHandler       = new DirectorySelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DirectoryItemViewModel          directoryItemVM = new DirectoryItemViewModel();


            bool result = directorySelectionHandler.MultiselectDesicions(true, directoryItemVM);

            Assert.AreEqual(true, result);
        }
コード例 #7
0
        public void MultiselectDesicions_IsMultiselectCombinationAllTypesAllowedTrue_DirectoryVMIsInListSelectedExplorerTreeItems()
        {
            SelectionConfiguration selectionConfiguration = new SelectionConfiguration();

            selectionConfiguration.IsMultiselectCombinationAllTypesAllowed = true;

            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            DirectorySelectionHandler       directorySelectionHandler       = new DirectorySelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DirectoryItemViewModel          directoryItemVM = new DirectoryItemViewModel();


            directorySelectionHandler.MultiselectDesicions(true, directoryItemVM);

            Assert.AreEqual(directoryItemVM, selectedExplorerTreeItemHandler.SelectedExplorerTreeItems.First());
        }
コード例 #8
0
        public void AddOrRemoveDirectoryAccordingToIsSelected_Remove_DirectoryVMIsInListSelectedDirectories()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);

            DirectorySelectionHandler directorySelectionHandler = new DirectorySelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DirectoryItemViewModel    directoryItemVM           = new DirectoryItemViewModel();

            selectedExplorerTreeItemHandler.SelectedDirectories.Add(new DirectoryItemViewModel());
            selectedExplorerTreeItemHandler.SelectedDirectories.Add(directoryItemVM);
            selectedExplorerTreeItemHandler.SelectedDirectories.Add(new DirectoryItemViewModel());
            selectedExplorerTreeItemHandler.SelectedDirectories.Add(new DirectoryItemViewModel());


            directorySelectionHandler.AddOrRemoveDirectoryAccordingToIsSelected(false, directoryItemVM);

            Assert.AreEqual(-1, selectedExplorerTreeItemHandler.SelectedDirectories.IndexOf(directoryItemVM));
        }