Пример #1
0
        public void HashCode()
        {
            const int id1 = 1;

            (new EntityStub()).GetHashCode()
            .Should("transients should not have same hash")
            .Not.Be.EqualTo((new EntityStub()).GetHashCode());

            EntityStub.NewWithId(id1).GetHashCode()
            .Should("persistent should have same hash.")
            .Be.EqualTo(EntityStub.NewWithId(id1).GetHashCode());

            EntityStub.NewWithId(id1).GetHashCode()
            .Should("persistent inherited should have same hash.")
            .Be.EqualTo(EntityStubInherit.NewWithId(id1).GetHashCode());
        }
Пример #2
0
 public void PersistentInheritedWithSameId()
 {
     EntityStubInherit.NewWithId(1).Should().Be.EqualTo(EntityStub.NewWithId(1));
 }