Ejemplo n.º 1
0
        public void GetPlaceholdersOneMatch()
        {
            var replacer     = new Replacer(DefaultDictionary, "INSERT INTO Wikifolio () VALUES ({gaxi})");
            var placeHolders = replacer.GetPlaceholders();

            Assert.AreEqual(1, placeHolders.Count);
            Assert.AreEqual("{gaxi}", placeHolders[0].ExactPlaceHolderWithBrackets);
        }
Ejemplo n.º 2
0
        public void GetPlaceholdersMultipleMatches()
        {
            var replacer     = new Replacer(DefaultDictionary, "INSERT INTO Wikifolio () VALUES ({gaxi},{haxi},{gaxi},{delay},{gaxi})");
            var placeHolders = replacer.GetPlaceholders();

            Assert.AreEqual(5, placeHolders.Count);
            Assert.AreEqual("{haxi}", placeHolders[1].ExactPlaceHolderWithBrackets);
            Assert.AreEqual("{gaxi}", placeHolders[4].ExactPlaceHolderWithBrackets);
        }
Ejemplo n.º 3
0
        public void GetPlaceholdersMultipleMatchesWithInvalidOptions()
        {
            var replacer = new Replacer(DefaultDictionary, "INSERT INTO Wikifolio () VALUES ({gaxi:123},{haxi:43},{gaxi},{delay},{gaxi})");

            Assert.Throws <InvalidOperationException>(() => replacer.GetPlaceholders());
        }
Ejemplo n.º 4
0
        public void GetPlaceholdersNoMatches()
        {
            var replacer = new Replacer(DefaultDictionary, "INSERT INTO Wikifolio () VALUES ()");

            Assert.AreEqual(0, replacer.GetPlaceholders().Count);
        }