Exemple #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());
        }
Exemple #2
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));
        }