Ejemplo n.º 1
0
 public DirectoryFileDialogViewModel(
     DirectoryFileDialogOperationPanelViewModel operationPanel = null,
     IExplorerTree explorerTree = null,
     IDirectoryFileDialogConfiguration initialConfiguration = null)
 {
     this.OperationPanel = operationPanel ?? new DirectoryFileDialogOperationPanelViewModel();
     this.ExplorerTree   = explorerTree ?? ExplorerTreeFactory.CreateExplorerTree();
     this.ExplorerTreeVM = ExplorerTree.ExplorerTreeVM;
     this.DirectoryFileDialogConfigurator = initialConfiguration ??
                                            new DirectoryFileDialogInitialConfiguration(ExplorerTree.Configuration);
     this.Visibility = Visibility.Collapsed;
 }
        private DirectoryFileDialogViewModel CreateTestableDirectoryFileDialogViewModel(
            DirectoryFileDialogOperationPanelViewModel fakeOperationPanel = null,
            IExplorerTree fakeExplorerTree = null,
            IDirectoryFileDialogConfiguration fakeInitialConfiguration = null)
        {
            var dialogOperationVM = new DefaultDialogOperationViewModel();

            fakeOperationPanel       = fakeOperationPanel ?? Substitute.For <DirectoryFileDialogOperationPanelViewModel>(dialogOperationVM);
            fakeExplorerTree         = fakeExplorerTree ?? Substitute.For <IExplorerTree>();
            fakeInitialConfiguration = fakeInitialConfiguration ?? Substitute.For <IDirectoryFileDialogConfiguration>();
            return(new DirectoryFileDialogViewModel(fakeOperationPanel, fakeExplorerTree, fakeInitialConfiguration));
        }