private void ToggleSelectionOfCurrentItem() { if (_currentItem.CurrentDirectory != null) { if (_selectedItems.Directories.Contains(_currentItem.CurrentDirectory)) { _selectedItems.Remove(_currentItem.CurrentDirectory); } else { _selectedItems.Add(_currentItem.CurrentDirectory); } return; } if (_currentItem.CurrentFile != null) { if (_selectedItems.Files.Contains(_currentItem.CurrentFile)) { _selectedItems.Remove(_currentItem.CurrentFile); } else { _selectedItems.Add(_currentItem.CurrentFile); } } }
public void Files_can_be_removed() { WhenItIsCreated(); var f1 = Mock.Of <IFile>(); var f2 = Mock.Of <IFile>(); _sut.Add(f1); _sut.Add(f2); _sut.Remove(f1); ThenTheSelectedFilesAre(f2); _sut.Remove(f2); ThenTheSelectedFilesAre(); ThenChangedWasRaised(4); }