Ejemplo n.º 1
0
    public void Can_Construct_Empty_ValueCollection_With_Default_EqualityComparer()
    {
        // Act
        var actual = new ValueCollection <string>();

        // Assert
        actual.Should().BeEmpty();
    }
Ejemplo n.º 2
0
    public void Can_Construct_Prefilled_ValueCollection_With_Default_EqualityComparer()
    {
        // Act
        var actual = new ValueCollection <string>(new[] { "a", "b", "c" });

        // Assert
        actual.Should().BeEquivalentTo(new[] { "a", "b", "c" });
    }
Ejemplo n.º 3
0
    public void Can_Construct_Empty_ValueCollection_With_Custom_EqualityComparer()
    {
        // Arrange
        var equalityComparerMock = new Mock <IEqualityComparer <string> >();

        // Act
        var actual = new ValueCollection <string>(equalityComparerMock.Object);

        // Assert
        actual.Should().BeEmpty();
    }
Ejemplo n.º 4
0
    public void Can_Construct_Prefilled_ValueCollection_With_Custom_EqualityComparer()
    {
        // Arrange
        var equalityComparerMock = new Mock <IEqualityComparer <string> >();

        equalityComparerMock.Setup(x => x.Equals(It.IsAny <string>(), It.IsAny <string>()))
        .Returns <string, string>((x, y) => x.ToUpperInvariant() == y.ToUpperInvariant());

        // Act
        var actual = new ValueCollection <string>(new[] { "a", "b", "c" }, equalityComparerMock.Object);

        // Assert
        actual.Should().BeEquivalentTo(new[] { "a", "b", "c" });
    }