Ejemplo n.º 1
0
    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());
    }
Ejemplo n.º 2
0
    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());
    }