示例#1
0
        public void AddOrRemoveFileAccordingToIsSelected_Add_FileVMIsInListSelectedFiles()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            FileSelectionHandler            fileSelectionHandler            = new FileSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            FileItemViewModel fileItemVM = new FileItemViewModel();

            fileSelectionHandler.AddOrRemoveFileAccordingToIsSelected(true, fileItemVM);

            Assert.AreEqual(fileItemVM, selectedExplorerTreeItemHandler.SelectedFiles.First());
        }
示例#2
0
        public void MultiselectDesicions_IsEnsuredOnlyFilesAreNowSelectableByMultiselectTrue_ReturnsTrue()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            FileSelectionHandler            fileSelectionHandler            = new FileSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            FileItemViewModel fileItemVM = new FileItemViewModel();

            bool result = fileSelectionHandler.MultiselectDesicions(true, fileItemVM);

            Assert.AreEqual(true, result);
        }
示例#3
0
        public void MultiselectDesicions_IsEnsuredOnlyFilesAreNowSelectableByMultiselectTrue_FileVMIsInListSelectedFiles()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            FileSelectionHandler            fileSelectionHandler            = new FileSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            FileItemViewModel fileItemVM = new FileItemViewModel();

            fileSelectionHandler.MultiselectDesicions(true, fileItemVM);

            Assert.AreEqual(fileItemVM, selectedExplorerTreeItemHandler.SelectedFiles.First());
        }
示例#4
0
        public void MultiselectDesicions_IsEnsuredOnlyFilesAreNowSelectableByMultiselectFalseBecauseDirectoryWasSelectedFirst_ReturnsFalse()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);

            selectedExplorerTreeItemHandler.SelectedDirectories.Add(new DirectoryItemViewModel());
            FileSelectionHandler fileSelectionHandler = new FileSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            FileItemViewModel    fileItemVM           = new FileItemViewModel();

            bool result = fileSelectionHandler.MultiselectDesicions(true, fileItemVM);

            Assert.AreEqual(false, result);
        }
示例#5
0
        public void MultiselectDesicions__IsMultiselectCombinationDirectoriesAndFilesAllowedTrue_AndIsEnsuredOnlyDirectoriesAndFilesAreNowSelectableByMultiselectTrue__FileVMIsInListSelectedFiles()
        {
            SelectionConfiguration selectionConfiguration = new SelectionConfiguration();

            selectionConfiguration.IsMultiselectCombinationDirectoriesAndFilesAllowed = true;

            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            FileSelectionHandler            fileSelectionHandler            = new FileSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            FileItemViewModel fileItemVM = new FileItemViewModel();


            bool result = fileSelectionHandler.MultiselectDesicions(true, fileItemVM);

            Assert.AreEqual(fileItemVM, selectedExplorerTreeItemHandler.SelectedFiles.First());
        }
示例#6
0
        public void MultiselectDesicions_IsMultiselectCombinationAllTypesAllowedTrue_ReturnsTrue()
        {
            SelectionConfiguration selectionConfiguration = new SelectionConfiguration();

            selectionConfiguration.IsMultiselectCombinationAllTypesAllowed = true;

            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            FileSelectionHandler            fileSelectionHandler            = new FileSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            FileItemViewModel fileItemVM = new FileItemViewModel();


            bool result = fileSelectionHandler.MultiselectDesicions(true, fileItemVM);

            Assert.AreEqual(true, result);
        }
示例#7
0
        public void MultiselectDesicions_IsMultiselectCombinationAllTypesAllowedTrue_FileVMIsInListSelectedExplorerTreeItems()
        {
            SelectionConfiguration selectionConfiguration = new SelectionConfiguration();

            selectionConfiguration.IsMultiselectCombinationAllTypesAllowed = true;

            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            FileSelectionHandler            fileSelectionHandler            = new FileSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            FileItemViewModel fileItemVM = new FileItemViewModel();


            fileSelectionHandler.MultiselectDesicions(true, fileItemVM);

            Assert.AreEqual(fileItemVM, selectedExplorerTreeItemHandler.SelectedExplorerTreeItems.First());
        }
示例#8
0
        public void MultiselectDesicions__IsMultiselectCombinationDirectoriesAndFilesAllowedTrue_AndIsEnsuredOnlyDirectoriesAndFilesAreNowSelectableByMultiselectFalseBecauseDriveWasSelectedFirst__ReturnsFalse()
        {
            SelectionConfiguration selectionConfiguration = new SelectionConfiguration();

            selectionConfiguration.IsMultiselectCombinationDirectoriesAndFilesAllowed = true;

            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);

            selectedExplorerTreeItemHandler.SelectedDrives.Add(new DriveItemViewModel());
            FileSelectionHandler fileSelectionHandler = new FileSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            FileItemViewModel    fileItemVM           = new FileItemViewModel();


            bool result = fileSelectionHandler.MultiselectDesicions(true, fileItemVM);

            Assert.AreEqual(false, result);
        }
示例#9
0
        public void AddOrRemoveFileAccordingToIsSelected_Remove_FileVMIsInListSelectedFiles()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);

            FileSelectionHandler fileSelectionHandler = new FileSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            FileItemViewModel    fileItemVM           = new FileItemViewModel();

            selectedExplorerTreeItemHandler.SelectedFiles.Add(new FileItemViewModel());
            selectedExplorerTreeItemHandler.SelectedFiles.Add(fileItemVM);
            selectedExplorerTreeItemHandler.SelectedFiles.Add(new FileItemViewModel());
            selectedExplorerTreeItemHandler.SelectedFiles.Add(new FileItemViewModel());


            fileSelectionHandler.AddOrRemoveFileAccordingToIsSelected(false, fileItemVM);

            Assert.AreEqual(-1, selectedExplorerTreeItemHandler.SelectedFiles.IndexOf(fileItemVM));
        }