public void ApplyAcceptsNullUrl()
        {
            var target = new CleanUrlTransformation();

            var entry = new LogEntry
            {
                csUriStem = null,
            };

            Assert.DoesNotThrow(() => target.Apply(entry));
            Assert.Null(entry.CleanUri);
        }
        public void ApplyLeavesOriginalUrlUntouched()
        {
            var target = new CleanUrlTransformation();

            string originalUrl = "my/url.php";

            var entry = new LogEntry
            {
                csUriStem = originalUrl,
            };

            target.Apply(entry);

            Assert.Equal(originalUrl, entry.csUriStem);
        }
        public void ApplyRemovesGuidsAndTrainlingSlah()
        {
            var target = new CleanUrlTransformation();

            string originalUrl = "my/url/" + Guid.NewGuid();
            string cleanlUrl = "my/url";

            var entry = new LogEntry
            {
                csUriStem = originalUrl,
            };

            target.Apply(entry);

            Assert.Equal(cleanlUrl, entry.CleanUri);
        }
        public void ApplyDoesNotTouchRootOnly()
        {
            var target = new CleanUrlTransformation();

            string originalUrl = "/" + Guid.NewGuid();
            string cleanlUrl = "/";

            var entry = new LogEntry
            {
                csUriStem = originalUrl,
            };

            target.Apply(entry);

            Assert.Equal(cleanlUrl, entry.CleanUri);
        }
        public void ApplyThrowsArgumentNullException()
        {
            var target = new CleanUrlTransformation();

            Assert.Throws<ArgumentNullException>(() => target.Apply(null));
        }