Exemple #1
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());
        }
        public void MultiselectDesicions_IsEnsuredOnlyDirectoriesAreNowSelectableByMultiselectTrue_DirectoryVMIsInListSelectedExplorerTreeItems()
        {
            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.SelectedExplorerTreeItems.First());
        }
        public void AddOrRemoveDirectoryAccordingToIsSelected_Add_DirectoryVMIsInListSelectedExplorerTreeItems()
        {
            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.SelectedExplorerTreeItems.First());
        }
        public void AddOrRemoveDriveAccordingToIsSelected_Add_DriveVMIsInListSelectedDirectories()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            DriveSelectionHandler           driveSelectionHandler           = new DriveSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DriveItemViewModel driveItemVM = new DriveItemViewModel();

            driveSelectionHandler.AddOrRemoveDriveAccordingToIsSelected(true, driveItemVM);

            Assert.AreEqual(driveItemVM, selectedExplorerTreeItemHandler.SelectedDrives.First());
        }
Exemple #5
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());
        }
        public void MultiselectDesicions_IsEnsuredOnlyDrivesAreNowSelectableByMultiselectTrue_ReturnsTrue()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            DriveSelectionHandler           driveSelectionHandler           = new DriveSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DriveItemViewModel driveItemVM = new DriveItemViewModel();

            bool result = driveSelectionHandler.MultiselectDesicions(true, driveItemVM);

            Assert.AreEqual(true, result);
        }
        public void MultiselectDesicions_IsEnsuredOnlyDrivesAreNowSelectableByMultiselectTrue_DriveVMIsInListSelectedDrives()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            DriveSelectionHandler           driveSelectionHandler           = new DriveSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DriveItemViewModel driveItemVM = new DriveItemViewModel();

            driveSelectionHandler.MultiselectDesicions(true, driveItemVM);

            Assert.AreEqual(driveItemVM, selectedExplorerTreeItemHandler.SelectedDrives.First());
        }
        public void MultiselectDesicions_IsEnsuredOnlyDrivesAreNowSelectableByMultiselectFalseBecauseFileWasSelectedFirst_ReturnsFalse()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);

            selectedExplorerTreeItemHandler.SelectedFiles.Add(new FileItemViewModel());
            DriveSelectionHandler driveSelectionHandler = new DriveSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DriveItemViewModel    driveItemVM           = new DriveItemViewModel();

            bool result = driveSelectionHandler.MultiselectDesicions(true, driveItemVM);

            Assert.AreEqual(false, result);
        }
        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());
        }
        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);
        }
Exemple #11
0
        public void MultiselectDesicions__IsMultiselectCombinationDirectoriesAndFilesAllowedTrue_AndIsEnsuredOnlyDirectoriesAndFilesAreNowSelectableByMultiselectTrue__FileVMIsInListSelectedExplorerTreeItems()
        {
            SelectionConfiguration selectionConfiguration = new SelectionConfiguration();

            selectionConfiguration.IsMultiselectCombinationDirectoriesAndFilesAllowed = 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());
        }
Exemple #12
0
        public void MultiselectDesicions_IsMultiselectCombinationAllTypesAllowedTrue_FileVMIsInListSelectedFiles()
        {
            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(fileItemVM, selectedExplorerTreeItemHandler.SelectedFiles.First());
        }
Exemple #13
0
        public void MultiselectDesicions__IsMultiselectCombinationDirectoriesAndFilesAllowedTrue_AndIsEnsuredOnlyDirectoriesAndFilesAreNowSelectableByMultiselectTrue__ReturnsTrue()
        {
            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(true, result);
        }
        public void MultiselectDesicions_IsMultiselectCombinationDirectoriesAndFilesAllowedTrue_ReturnsFalse()
        {
            SelectionConfiguration selectionConfiguration = new SelectionConfiguration();

            selectionConfiguration.IsMultiselectCombinationDirectoriesAndFilesAllowed = true;

            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            DriveSelectionHandler           driveSelectionHandler           = new DriveSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DriveItemViewModel driveItemVM = new DriveItemViewModel();


            bool result = driveSelectionHandler.MultiselectDesicions(true, driveItemVM);

            Assert.AreEqual(false, result);
        }
        public void MultiselectDesicions_IsMultiselectCombinationAllTypesAllowedTrue_DriveVMIsInListSelectedDirectories()
        {
            SelectionConfiguration selectionConfiguration = new SelectionConfiguration();

            selectionConfiguration.IsMultiselectCombinationAllTypesAllowed = true;

            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);
            DriveSelectionHandler           driveSelectionHandler           = new DriveSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DriveItemViewModel driveItemVM = new DriveItemViewModel();


            driveSelectionHandler.MultiselectDesicions(true, driveItemVM);

            Assert.AreEqual(driveItemVM, selectedExplorerTreeItemHandler.SelectedDrives.First());
        }
        public void MultiselectDesicions__IsMultiselectCombinationDirectoriesAndFilesAllowedTrue_AndIsEnsuredOnlyDirectoriesAndFilesAreNowSelectableByMultiselectFalseBecauseDriveWasSelectedFirst__ReturnsFalse()
        {
            SelectionConfiguration selectionConfiguration = new SelectionConfiguration();

            selectionConfiguration.IsMultiselectCombinationDirectoriesAndFilesAllowed = true;

            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);

            selectedExplorerTreeItemHandler.SelectedDrives.Add(new DriveItemViewModel());
            DirectorySelectionHandler directorySelectionHandler = new DirectorySelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DirectoryItemViewModel    directoryItemVM           = new DirectoryItemViewModel();


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

            Assert.AreEqual(false, result);
        }
        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));
        }
        public void AddOrRemoveDriveAccordingToIsSelected_Remove_DriveVMIsInListSelectedExplorerTreeItems()
        {
            SelectionConfiguration          selectionConfiguration          = new SelectionConfiguration();
            SelectedExplorerTreeItemHandler selectedExplorerTreeItemHandler = new SelectedExplorerTreeItemHandler(selectionConfiguration);

            DriveSelectionHandler driveSelectionHandler = new DriveSelectionHandler(selectedExplorerTreeItemHandler, selectionConfiguration);
            DriveItemViewModel    driveItemVM           = new DriveItemViewModel();

            selectedExplorerTreeItemHandler.SelectedExplorerTreeItems.Add(new DriveItemViewModel());
            selectedExplorerTreeItemHandler.SelectedExplorerTreeItems.Add(driveItemVM);
            selectedExplorerTreeItemHandler.SelectedExplorerTreeItems.Add(new DriveItemViewModel());
            selectedExplorerTreeItemHandler.SelectedExplorerTreeItems.Add(new DriveItemViewModel());


            driveSelectionHandler.AddOrRemoveDriveAccordingToIsSelected(false, driveItemVM);

            Assert.AreEqual(-1, selectedExplorerTreeItemHandler.SelectedExplorerTreeItems.IndexOf(driveItemVM));
        }
Exemple #19
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));
        }