Exemple #1
0
        public void RegexFindKeysAndValuesFindsUrlAndCategory()
        {
            var url      = "http://www.co.yavapai.az.us/_Events.aspx?id=32794&foo=bar#asdf%d3-abc";
            var category = "music,arts";
            var s        = string.Format(@"

url={0}	
         
sys.path.append(""c:\users\jonu\dev"")
import clr

category={1}  

clr.AddReference(""System.Core"")
import System


",
                                         url, category);
            var keys = new List <string>()
            {
                "url", "category"
            };
            var metadict = GenUtils.RegexFindKeysAndValues(keys, s);

            Assert.That(metadict["url"] == url);
            Assert.That(metadict["category"] == category);
        }