Beispiel #1
0
 public void Execute()
 {
     try {
         FilesViewPresenter.RefreshDirectory();
     } catch (FileEntityNotFoundException) {
         messageHelper.Show("Failed to refresh folder.", "Ошибка при обновлении папки.");
         FilesViewPresenter.OpenDefaultDirectory();
     }
 }
Beispiel #2
0
        public void OpenDefaultDirectory_CheckRefreshOptionsInitialDirectory()
        {
            var path = Path.Combine(testFolder, "documents");

            Directory.CreateDirectory(path);

            environmentHelper.Setup(x => x.GetMyDocumentsPath())
            .Returns(path);

            var directoryEntity = new Mock <IDirectoryEntity>();

            directoryEntity.Setup(x => x.GetDirectories()).Returns(new List <FileSystemEntity>());

            directoryEntity.Setup(x => x.GetFiles()).Returns(new List <FileSystemEntity>());

            directoryEntity.Setup(x => x.FullName).Returns(path);

            filesViewPresenter = CreateFilesViewPresenter();

            filesViewPresenter.OpenDefaultDirectory();

            Assert.AreEqual(Path.GetFullPath(path), options.InitialDirectory);
        }