URL canonicalization strategy using a map/dictionary data structure to map old paths to new ones.
Inheritance: IUrlStrategy
Ejemplo n.º 1
0
        public void AssertUrlChange(string originalUrl, string expectedCanonicalUrl)
        {
            var uriBuilder = new UriBuilder(originalUrl);

            var dictionary = new Dictionary<string, string>
            {
                {"/foo", "/bar"}
            };

            IUrlStrategy strategy = new MapStrategy(dictionary);
            strategy.Apply(uriBuilder);

            Assert.That(uriBuilder.Uri, Is.EqualTo(new Uri(expectedCanonicalUrl)));
        }