Example #1
0
        public void Empty()
        {
            using var reader = new StringReader(string.Empty);
            var nameReader = new NameTextReader(reader);

            Assert.Empty(nameReader);
        }
Example #2
0
        public void Whitespace()
        {
            using var reader = new StringReader("\n\n\n\n");
            var nameReader = new NameTextReader(reader);

            Assert.Empty(nameReader);
        }
Example #3
0
        public void Comments()
        {
            using var reader = new StringReader("# comment 1\n# comment 2");
            var nameReader = new NameTextReader(reader);

            Assert.Empty(nameReader);
        }
Example #4
0
        public void SingleLine()
        {
            const string text = @"
en-US Some pattern
";

            using var reader = new StringReader(text);
            var nameReader = new NameTextReader(reader);

            var pattern = Assert.Single(nameReader);

            Assert.Equal("en-US", pattern.Culture);
            Assert.Equal("Some pattern", pattern.Pattern);
        }