Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldReadFromMultipleReaders() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldReadFromMultipleReaders()
        {
            // GIVEN
            string[][] data = new string[][]
            {
                new string[] { "this is", "the first line" },
                new string[] { "where this", "is the second line" },
                new string[] { "and here comes", "the third line" }
            };
            RawIterator <CharReadable, IOException> readers = ReaderIteratorFromStrings(data, null);
            CharSeeker seeker = CharSeekers.CharSeeker(new MultiReadable(readers), CONFIG, true);

            // WHEN/THEN
            foreach (string[] line in data)
            {
                AssertNextLine(line, seeker, _mark, _extractors);
            }
            assertFalse(seeker.Seek(_mark, _delimiter));
            seeker.Dispose();
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldParseHeaderFromFirstLineOfFirstInputFile() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldParseHeaderFromFirstLineOfFirstInputFile()
        {
            // GIVEN
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.csv.reader.CharReadable firstSource = wrap("id:ID\tname:String\tbirth_date:long");
            CharReadable firstSource = wrap("id:ID\tname:String\tbirth_date:long");
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.csv.reader.CharReadable secondSource = wrap("0\tThe node\t123456789");
            CharReadable secondSource = wrap("0\tThe node\t123456789");
            DataFactory  dataFactory  = DataFactories.Data(value => value, () => new MultiReadable(Readables.iterator(IOFunctions.identity(), firstSource, secondSource)));

            Header.Factory headerFactory = defaultFormatNodeFileHeader();
            Extractors     extractors    = new Extractors(';');

            // WHEN
            CharSeeker seeker = CharSeekers.charSeeker(new MultiReadable(dataFactory.Create(_tabs).stream()), _tabs, false);
            Header     header = headerFactory.Create(seeker, _tabs, IdType.Actual, _groups);

            // THEN
            assertArrayEquals(array(Entry("id", Type.Id, extractors.Long_()), Entry("name", Type.Property, extractors.String()), Entry("birth_date", Type.Property, extractors.Long_())), header.Entries());
            seeker.Dispose();
        }
Пример #3
0
 private CharSeeker Seeker(string data)
 {
     return(CharSeekers.charSeeker(wrap(data), SEEKER_CONFIG, false));
 }