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_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); }
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_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); }
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()); }
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); }
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()); }
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); }
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)); }