コード例 #1
0
ファイル: WorkTests.cs プロジェクト: FolkerKinzel/Contacts
    public void EqualsTest6()
    {
        var addr1 = new Address
        {
            Street = "Berliner Str. 42",
            City   = "Berghain"
        };


        var work1 = new Work
        {
            AddressWork = addr1,
            Company     = "Folkers Firma",
            JobTitle    = "   "
        };

        var addr2 = new Address
        {
            Street = "Berliner Str. 42",
            City   = "berghain"
        };


        var work2 = new Work
        {
            AddressWork = addr2,

            JobTitle = "Generaldirektor"
        };

        Assert.IsFalse(work1.Equals(work2));
        Assert.AreNotEqual(work1.GetHashCode(), work2.GetHashCode());
        Assert.IsTrue(Work.AreMergeable(work1, work2));
    }
コード例 #2
0
ファイル: WorkTests.cs プロジェクト: FolkerKinzel/Contacts
    public void GetHashCodeTest1()
    {
        var work1 = new Work();
        var work2 = new Work
        {
            JobTitle = "Chef"
        };

        Assert.IsFalse(work1.Equals(work2));
        Assert.AreNotEqual(work1.GetHashCode(), work2.GetHashCode());
        Assert.IsTrue(Work.AreMergeable(work1, work2));
    }