public void EnteringInitialNameModeBeginsEdit() { var folder = new LibraryFolderNode(_unitTestDispatcher.Dispatcher, _eventAggregator); folder.EnterInitialNameMode(); Assert.That(folder.EditLabel, Is.True); }
public void NewFolderSpecifiesParent() { var folder = new LibraryFolderNode(_unitTestDispatcher.Dispatcher, _eventAggregator) { Id = TestIds.GetId(0), Path = new [] { "Parent" } }; folder.NewFolder.Execute(null); Assert.That(_listener.Requests, Is.EqualTo("AddFolder Parent\\\r\n")); }
public void OutsideInitialNameModeCancelEditDoesNotRequestDelete() { var folder = new LibraryFolderNode(_unitTestDispatcher.Dispatcher, _eventAggregator) { Id = TestIds.GetId(0) }; folder.BeginEditLabel.Execute(null); folder.CancelEditLabel.Execute(null); Assert.That(_listener.Requests, Is.EqualTo("Select Id0\r\n")); }
public void SetUp() { _eventAggregator = new UnitTestEventAggregator(); _listener = new EventListener(); _eventAggregator.AddListener(_listener); _unitTestDispatcher = new UnitTestDispatcher(); _node = new LibraryFileNode(_unitTestDispatcher.Dispatcher, _eventAggregator); _node.Id = TestIds.GetId(0); _node.Id = TestIds.GetId(0); _node.Name = "original name"; _folderNode = new LibraryFolderNode(_unitTestDispatcher.Dispatcher, _eventAggregator) { Id = TestIds.GetId(1), Path = new [] { "Parent" } }; }
private LibraryViewNode FindParentNode(string[] path, IList <LibraryViewNode> items, LibraryViewNode parentNode) { if (path.Length == 0) { return(parentNode); } var parent = items.FirstOrDefault(i => i.Name == path[0] && i is LibraryFolderNode); if (parent == null) { parent = new LibraryFolderNode(_dispatcher, _eventAggregator) { Id = Guid.NewGuid(), Name = path[0], Parent = parentNode, Path = parentNode == null ? null : parentNode.GetPathForChild() }; items.Add(parent); } return(FindParentNode(path.Skip(1).ToArray(), parent.Children, parent)); }
public void ByDefaultFolderIsNotInLabelEditMode() { var folder = new LibraryFolderNode(_unitTestDispatcher.Dispatcher, _eventAggregator); Assert.That(folder.EditLabel, Is.False); }