Exemplo n.º 1
0
        public void SplitIntoPiecesComplexTest()
        {
            var actual   = PatternParser.SplitIntoPieces("{}a}b{{1}}c{d{\\\\");
            var expected = new List <PatternPiece>
            {
                new PatternPiece("a}b", 2, PatternPieceType.PlainString),
                new PatternPiece("{1", 5, PatternPieceType.BraceContent),
                new PatternPiece("}c{d{\\", 9, PatternPieceType.PlainString)
            };

            Assert.Equal(expected, actual);
        }
Exemplo n.º 2
0
        public void SplitIntoPiecesSimpleTest()
        {
            var actual = PatternParser.SplitIntoPieces("a{1}b");

            var expected = new List <PatternPiece>
            {
                new PatternPiece("a", 0, PatternPieceType.PlainString),
                new PatternPiece("1", 1, PatternPieceType.BraceContent),
                new PatternPiece("b", 4, PatternPieceType.PlainString)
            };

            Assert.Equal(expected, actual);
        }