Ejemplo n.º 1
0
 public void PassingNonExistingDirectory_RegistersError__CustomStub()
 {
     // Arrange
     var dirService = new DirServiceStub();
     dirService.DirectoryExistsResult = false;
     var filesFinder = new FilesFinder(dirService);
     // Act
     filesFinder.SearchWithSameNames("NonExisting");
     // Assert
     Assert.AreEqual(1, filesFinder.GetLastErrors().Count, "Non existing directory error expected");
 }
Ejemplo n.º 2
0
 public void InEmptyDir_NoResults__CustomStub()
 {
     // Arrange
     var dirService = new DirServiceStub();
     dirService.DirectoryExistsResult = true;
     dirService.GetFilesResult = new string[0];
     dirService.GetDirectoriesResult = new string[0];
     var filesFinder = new FilesFinder(dirService);
     // Act
     var result = filesFinder.SearchWithSameNames("Empty");
     // Assert
     Assert.AreEqual(0, result.Count, "No files expected in empty directory");
 }