public void EncodeValue_EncodesOnlySlashes_WhenEncodeSlashes_IsFalse()
        {
            // Arrange
            var urlTestEncoder      = new UrlTestEncoder();
            var value               = "a/b b1/c";
            var expected            = "/UrlEncode[[a]]/UrlEncode[[b b1]]/UrlEncode[[c]]";
            var uriBuilldingContext = new UriBuildingContext(urlTestEncoder);

            // Act
            uriBuilldingContext.EncodeValue(value, 0, value.Length, encodeSlashes: false);

            // Assert
            Assert.Equal(expected, uriBuilldingContext.ToString());
        }
        public void ToPathString(string url, bool appendTrailingSlash, bool encodeSlashes, string expected)
        {
            // Arrange
            var urlTestEncoder      = new UrlTestEncoder();
            var uriBuilldingContext = new UriBuildingContext(urlTestEncoder);

            uriBuilldingContext.AppendTrailingSlash = appendTrailingSlash;

            // Act
            uriBuilldingContext.Accept(url, encodeSlashes);

            // Assert
            Assert.Equal(expected, uriBuilldingContext.ToPathString().Value);
        }
        public void EncodeValue_EncodesOnlySlashes_WithinSubsegment_WhenEncodeSlashes_IsFalse(
            string value,
            int startIndex,
            int characterCount,
            string expected)
        {
            // Arrange
            var urlTestEncoder      = new UrlTestEncoder();
            var uriBuilldingContext = new UriBuildingContext(urlTestEncoder);

            // Act
            uriBuilldingContext.EncodeValue(value, startIndex, characterCount, encodeSlashes: false);

            // Assert
            Assert.Equal(expected, uriBuilldingContext.ToString());
        }