public void ShouldGetFilesAndFoldersMatchingEndOfInputIfInputIsNotFileOrFolder()
 {
     using (_mockRepository.Record())
     {
         Expect.Call(_fileSystemManagerMock.DirectoryExists(SomeFolder + @"\a")).Return(false);
         Expect.Call(_fileSystemManagerMock.FileAndFolderNamesIn(SomeFolder, "a*")).Return(SomeFileAndFolders);
     }
     using (_mockRepository.Playback())
     {
         _provider = new FileSystemAutoCompleteProvider(_fileSystemManagerMock);
         var suggestions = _provider.GetSuggestionsFor(SomeFolder + @"\a");
         CollectionAssert.AreEqual(SomeFileAndFolders, suggestions);
     }
 }
 public void ShouldGetFilsOnlyIfSpecified()
 {
     using (_mockRepository.Record())
     {
         Expect.Call(_fileSystemManagerMock.DirectoryExists(SomeFolder)).Return(true);
         Expect.Call(_fileSystemManagerMock.FilenamesIn(SomeFolder, string.Empty))
             .Return(SomeFiles);
     }
     using (_mockRepository.Playback())
     {
         _provider = new FileSystemAutoCompleteProvider(_fileSystemManagerMock, CompletionType.FilesOnly);
         var suggestions = _provider.GetSuggestionsFor(SomeFolder);
         CollectionAssert.AreEqual(SomeFiles, suggestions);
     }
 }
Ejemplo n.º 3
0
 private static IEnumerable<IWizardStep<IStepView>> GetSteps(WizardModel model)
 {
     var fileSystemManager = new FileSystemManager();
     var folderAutoCompleteProvider = new FileSystemAutoCompleteProvider(fileSystemManager, CompletionType.FoldersOnly);
     var databaseTypes = new[] {"sqlserver", "mysql", "sqlite", "oracle"};
     var steps = new List<IWizardStep<IStepView>>
         {
             new SelectProfileStep(model, new WpfSelectProfileStepView(), ProfileManager.Instance),
             new SelectPackageStep(model, new WpfSelectPackageStepView(), fileSystemManager),
             new SetUpBackupStep(model, new WpfSetUpBackupStepView(folderAutoCompleteProvider),fileSystemManager),
             new SetUpDeployStatusStep(model, new WpfSetUpDeployStatusStepView(), fileSystemManager),
             new SetUpGenerateWebConfigStep(model, new WpfSetUpGenerateWebConfigStepView(),fileSystemManager),
             new SetUpDestinationStep(model, new WpfSetUpDestinationStepView(), fileSystemManager),
             new SetUpMigrationStep(new DatabaseConnectionTester(), model,new WpfSetUpMigrationStepView(databaseTypes)),
             new SummaryStep(model, new WpfSummaryStepView())
         };
     return steps;
 }
 public void ShouldReturnEmptyListWhenInputIsWhitespace()
 {
     _provider = new FileSystemAutoCompleteProvider(_fileSystemManagerMock);
     CollectionAssert.AreEqual(new string[0], _provider.GetSuggestionsFor("   "));
 }
 public void ShouldReturnEmptyListWhenInputIsEmpty()
 {
     _provider = new FileSystemAutoCompleteProvider(_fileSystemManagerMock);
     CollectionAssert.AreEqual(_provider.GetSuggestionsFor(string.Empty), new string[0]);
 }