Exemplo n.º 1
0
    public void AreDifferentWhenSecondTupleItemIsDifferent()
    {
        var left = new Target
        {
            _field    = "test",
            Property1 = new Tuple <int, string>(5, "test"),
        };

        var right = new Target
        {
            _field    = "test",
            Property1 = new Tuple <int, string>(5, "Test"),
        };

        Assert.NotEqual(left, right);
        Assert.NotEqual(left.GetHashCode(), right.GetHashCode());
    }
Exemplo n.º 2
0
    public void AreEqualWhenAllPropertiesAreEqual()
    {
        var left = new Target
        {
            _field    = "test",
            Property1 = new Tuple <int, string>(5, "test"),
        };

        var right = new Target
        {
            _field    = "test",
            Property1 = new Tuple <int, string>(5, "test"),
        };

        Assert.Equal(left, right);
        Assert.Equal(left.GetHashCode(), right.GetHashCode());
    }