public void Files_are_searched_in_specified_directory_and_not_subdirectories() { var provider = new SourceFileProvider(Directory.GetCurrentDirectory()); Assert.That(provider.TryGetFilenamesForModule(ModuleName, out var filenames), Is.True); var expected1 = Path.GetFullPath(Path.Combine(ModuleName, "file1.cle")); var expected2 = Path.GetFullPath(Path.Combine(ModuleName, "file2.cle")); CollectionAssert.AreEqual(new[] { expected1, expected2 }, filenames); }
public void Files_are_searched_in_default_directory_and_not_subdirectories() { var provider = new SourceFileProvider(Path.GetFullPath(ModuleName)); Assert.That(provider.TryGetFilenamesForModule(".", out var filenames), Is.True); // The order must be fixed, and only .cle files in the exact directory must be found var expected1 = Path.GetFullPath(Path.Combine(ModuleName, "file1.cle")); var expected2 = Path.GetFullPath(Path.Combine(ModuleName, "file2.cle")); CollectionAssert.AreEqual(new[] { expected1, expected2 }, filenames); }
public void Getting_filenames_fails_for_nonexistent_path() { var provider = new SourceFileProvider(Directory.GetCurrentDirectory()); Assert.That(provider.TryGetFilenamesForModule("Nonexistent", out var _), Is.False); }