示例#1
0
        public void ToSingleStringWithEmptySeparator()
        {
            IParsedFile parsedFile = new ParsedFile(Path.Combine(_sampleFolderPath, "ToSingleString.txt"));

            IParsedLine firstLine = parsedFile.NextLine();

            Assert.Equal(
                "0This1234isalinewithsomelinesoftext404",
                firstLine.ToSingleString(string.Empty));

            Assert.True(firstLine.Empty);
        }
示例#2
0
        public void ToSingleStringWithCustomSeparator()
        {
            IParsedFile parsedFile = new ParsedFile(Path.Combine(_sampleFolderPath, "ToSingleString.txt"));

            parsedFile.NextLine();
            IParsedLine secondLine = parsedFile.NextLine();

            Assert.Equal(
                "Second^~line^~1^~2^~34",
                secondLine.ToSingleString("^~"));

            Assert.True(secondLine.Empty);
        }
示例#3
0
        public void ToSingleStringWithDefaultSeparator()
        {
            IParsedFile parsedFile = new ParsedFile(Path.Combine(_sampleFolderPath, "ToSingleString.txt"));

            IParsedLine firstLine = parsedFile.NextLine();

            Assert.Equal(0, firstLine.NextElement <int>());
            Assert.Equal("This", firstLine.NextElement <string>());

            Assert.Equal(
                "1234 is a line with some lines of text 404",
                firstLine.ToSingleString());

            Assert.True(firstLine.Empty);
        }