Ejemplo n.º 1
0
    public void MergableTest1(string?val1, string?val2)
    {
        var o1 = new PhoneNumber(val1);
        var o2 = new PhoneNumber(val2);

        Assert.IsTrue(PhoneNumber.AreMergeable(o1, o2));
    }
Ejemplo n.º 2
0
    public void MergableTest2()
    {
        var o1 = new PhoneNumber("4711", isFax: false);
        var o2 = new PhoneNumber("4711", isFax: true);

        Assert.AreNotEqual(o1, o2);
        Assert.AreNotEqual(o1.GetHashCode(), o2.GetHashCode());
        Assert.IsTrue(PhoneNumber.AreMergeable(o1, o2));
    }
Ejemplo n.º 3
0
    public void EqualsTestFalse1(string?val1, string?val2)
    {
        object o1 = new PhoneNumber(val1);
        object o2 = new PhoneNumber(val2);

        Assert.IsFalse(o1.Equals(o2));
        Assert.AreNotEqual(o1.GetHashCode(), o2.GetHashCode());
        Assert.IsFalse(PhoneNumber.AreMergeable(o1 as PhoneNumber, o2 as PhoneNumber));
    }
Ejemplo n.º 4
0
    public void EqualsTestFalse2(string?val1, string?val2)
    {
        var o1 = new PhoneNumber(val1);
        var o2 = new PhoneNumber(val2);

        Assert.IsFalse(o1.Equals(o2));
        Assert.IsFalse(o1 == o2);
        Assert.IsFalse(o2 == o1);
        Assert.IsTrue(o1 != o2);
        Assert.IsTrue(o2 != o1);
        Assert.AreNotEqual(o1.GetHashCode(), o2.GetHashCode());
        Assert.IsFalse(PhoneNumber.AreMergeable(o1, o2));
    }