예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        public void Files_can_be_selected()
        {
            WhenItIsCreated();

            var f1 = Mock.Of <IFile>();
            var f2 = Mock.Of <IFile>();

            ThenTheSelectedFilesAre();

            _sut.Add(f1);

            ThenTheSelectedFilesAre(f1);

            _sut.Add(f2);

            ThenTheSelectedFilesAre(f1, f2);
            ThenChangedWasRaised(2);
        }