Example #1
0
    public void EqualsTest4()
    {
        var name1 = new Name()
        {
            LastName  = "Davis",
            FirstName = "Sammy",
            Suffix    = "jr."
        };

        var name2 = new Name()
        {
            LastName  = "Davis",
            FirstName = "Sammy"
        };

        Assert.IsFalse(name1.Equals(name2));
        Assert.AreNotEqual(name1.GetHashCode(), name2.GetHashCode());
        Assert.IsTrue(Name.AreMergeable(name1 as Name, name2 as Name));
    }
Example #2
0
    public void EqualsTest1()
    {
        object name1 = new Name()
        {
            LastName  = "Davis",
            FirstName = "Sammy",
            Suffix    = "jr."
        };

        object name2 = new Name()
        {
            Prefix    = "Dr.",
            LastName  = "Davis",
            FirstName = "sammy",
            Suffix    = "Jr."
        };

        Assert.IsFalse(name1.Equals(name2));
        Assert.AreNotEqual(name1.GetHashCode(), name2.GetHashCode());
        Assert.IsTrue(Name.AreMergeable(name1 as Name, name2 as Name));
    }