예제 #1
0
        public void GetUrlGeneratorXkcd()
        {
            var xkcdUrl    = "http://xkcd.com/614";
            var xkcdParser = new ComicParser(xkcdUrl);

            // get the generator object - should be the right type
            UrlGenerator urlGen = xkcdParser.GetUrlGenerator();

            Assert.IsTrue(urlGen.ToString().Contains("SequentialGenerator"));
        }
예제 #2
0
        private string ManipulateURL_After_Hash(string url, Action <UrlGenerator> internalActions)
        {
            int i = url.IndexOf('#');

            string frontUrl = "";
            string proxyUrl = url;

            if (i > 0 && i != url.Length - 1)
            {
                frontUrl = url.Substring(0, i + 1);
                proxyUrl = url.Substring(i + 1);
            }

            UrlGenerator urlGen = new UrlGenerator(proxyUrl);

            internalActions.Invoke(urlGen);

            return(frontUrl + urlGen.ToString());
        }