Example #1
0
        public void TestYieldsNewLineCharactersAndDoesntThrowThemAway()
        {
            FileEnumerator f = new FileEnumerator(Fixture.PathFor("alphabet-vertical.txt"));

            var newlineCount = f.GetChars().Count(c => c == '\n');

            Assert.That(newlineCount, Is.EqualTo(26));
        }
Example #2
0
        public void TestHandlesUTF8Files()
        {
            FileEnumerator f = new FileEnumerator(Fixture.PathFor("alphabet-utf8.txt"));

            var count = f.GetChars().Count();

            Assert.That(count, Is.EqualTo(26));
        }
Example #3
0
        public void TestYieldsCharactersFromTheFile()
        {
            FileEnumerator f = new FileEnumerator(Fixture.PathFor("alphabet.txt"));

            var alphabet = f.GetChars().Take(8).ToArray();

            Assert.That(alphabet, Is.EqualTo(new char[] {
                'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'
            }));
        }