コード例 #1
0
        public void EnumerateFilesWithoutExtension_returns_empty_when_directory_does_not_exist()
        {
            var path = Path.GetTempPath();

            FileEnumerator.EnumerateFilesWithoutExtension(
                new DirectoryInfo(Path.Combine(path,
                                               Path.GetRandomFileName(),
                                               "notexist")))
            .Should().BeEmpty();
        }
コード例 #2
0
        public void EnumerateFilesWithoutExtension_returns_files_without_extension()
        {
            var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

            try
            {
                Directory.CreateDirectory(path);
                File.WriteAllText(Path.Combine(path, "dotnet-suggest"), "");
                File.WriteAllText(Path.Combine(path, "t-rex"), "");
                FileEnumerator.EnumerateFilesWithoutExtension(new DirectoryInfo(path))
                .Should()
                .BeEquivalentTo(
                    GlobalToolsSuggestionRegistrationTests
                    .FilesNameWithoutExtensionUnderDotnetProfileToolsExample);
            }
            finally
            {
                Directory.Delete(path, true);
            }
        }
コード例 #3
0
 public void EnumerateFilesWithoutExtension_returns_empty_when_pass_in_null()
 {
     FileEnumerator.EnumerateFilesWithoutExtension(null).Should().BeEmpty();
 }