Example #1
0
    public void NormalizeRange_ReturnsNullWhenRangeEndEqualsZero()
    {
        // Arrange & Act
        var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(null, 0), 1);

        // Assert
        Assert.Null(normalizedRange);
    }
Example #2
0
    public void NormalizeRange_ReturnsNullWhenRangeStartEqualsOrGreaterThanLength(long start, long end)
    {
        // Arrange & Act
        var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(start, end), 1);

        // Assert
        Assert.Null(normalizedRange);
    }
Example #3
0
    public void NormalizeRange_ReturnsRangeWithNoChange()
    {
        // Arrange & Act
        var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(1, 3), 4);

        // Assert
        Assert.Equal(1, normalizedRange.From);
        Assert.Equal(3, normalizedRange.To);
    }
Example #4
0
    public void NormalizeRange_ReturnsNormalizedRange(long?start, long?end, long?normalizedStart, long?normalizedEnd)
    {
        // Arrange & Act
        var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(start, end), 3);

        // Assert
        Assert.Equal(normalizedStart, normalizedRange.From);
        Assert.Equal(normalizedEnd, normalizedRange.To);
    }