ListCandidates() public static method

Returns a list of entry point Candidates in a directory.
public static ListCandidates ( DirectoryInfo baseDirectory ) : List
baseDirectory System.IO.DirectoryInfo The base directory to scan for entry points.
return List
示例#1
0
        public void TestListCandidates()
        {
            Deploy(DotNetExeTest.Reference, xbit: false);
            Deploy(PythonScriptTest.Reference, xbit: true);
            Deploy(PosixScriptTest.Reference, xbit: true);
            Deploy(PosixBinaryTest.Reference32, xbit: true);

            var candidates = Detection.ListCandidates(Directory).ToList();

            candidates.Should().BeEquivalentTo(
                DotNetExeTest.Reference,
                PythonScriptTest.Reference,
                PosixScriptTest.Reference,
                PosixBinaryTest.Reference32);
        }
示例#2
0
        public void TestListCandidates()
        {
            Deploy(DotNetExeTest.Reference, xbit: false);
            Deploy(WindowsExeTest.Reference32, xbit: false);
            Deploy(PythonScriptTest.Reference, xbit: true);
            Deploy(PosixScriptTest.Reference, xbit: true);
            Deploy(PosixBinaryTest.Reference32, xbit: true);

            var candidates = Detection.ListCandidates(Directory).ToList();

            CollectionAssert.AreEquivalent(
                new Candidate[]
            {
                DotNetExeTest.Reference,
                WindowsExeTest.Reference32,
                PythonScriptTest.Reference,
                PosixScriptTest.Reference,
                PosixBinaryTest.Reference32
            },
                candidates);
        }
示例#3
0
 public void TestEmpty()
 {
     FileUtils.Touch(Path.Combine(Directory.FullName, "empty"));
     Assert.IsEmpty(Detection.ListCandidates(Directory).ToList());
 }
示例#4
0
 [Fact] // Should not fail on empty files
 public void TestEmpty()
 {
     FileUtils.Touch(Path.Combine(Directory.FullName, "empty"));
     Detection.ListCandidates(Directory).Should().BeEmpty();
 }