public DirectoryScanner(TextWriter infoTextWriter, Encoding encoding)
 {
     this.filenameParser = new FilenameParser();
     
     this.infoTextWriter = infoTextWriter;
     this.encoding = encoding;
 }
        public AssemblyScanner(TextWriter writer, Encoding encoding, Assembly assembly, Func<string, bool> resourceNameFilter = null)
        {
            filenameParser = new FilenameParser();

            infoTextWriter = writer;
            this.encoding = encoding;
            this.assembly = assembly;
            this.resourceNameFilter = resourceNameFilter;
        }
 public void CanParseAnyFilenameThatStartsWithANumber()
 {
     FilenameParser parser = new FilenameParser();
     Assert.AreEqual(1, parser.ExtractScriptNumberFromFilename("0001_a_filename.txt"));
     Assert.AreEqual(1, parser.ExtractScriptNumberFromFilename("1_a_filename.txt"));
     Assert.AreEqual(1, parser.ExtractScriptNumberFromFilename("1 a filename.txt"));
     Assert.AreEqual(1, parser.ExtractScriptNumberFromFilename("1.txt"));
     Assert.AreEqual(123, parser.ExtractScriptNumberFromFilename("00123_something.txt"));
     Assert.AreEqual(1, parser.ExtractScriptNumberFromFilename("1.foo.2.txt"));
 }
 public void CanParseAnyFilenameThatStartsWithANumber()
 {
     FilenameParser parser = new FilenameParser();
     Assert.AreEqual(1, parser.ExtractIdFromFilename("0001_a_filename.txt"));
     Assert.AreEqual(1, parser.ExtractIdFromFilename("1_a_filename.txt"));
     Assert.AreEqual(1, parser.ExtractIdFromFilename("1 a filename.txt"));
     Assert.AreEqual(1, parser.ExtractIdFromFilename("1.txt"));
     Assert.AreEqual(123, parser.ExtractIdFromFilename("00123_something.txt"));
     Assert.AreEqual(1, parser.ExtractIdFromFilename("1.foo.2.txt"));
     Assert.AreEqual(200808231059, parser.ExtractIdFromFilename("200808231059.timestamped_filename.sql"));
 }
Esempio n. 5
0
 public DirectoryScanner(TextWriter infoTextWriter)
 {
     filenameParser = new FilenameParser();
     this.infoTextWriter = infoTextWriter;
 }
 public DirectoryScanner()
 {
     filenameParser = new FilenameParser();
 }