コード例 #1
0
        public void EqualsWithDifferentIdsInDisparateClassesReturnsFalse()
        {
            var obj1 = new SimpleDomainObject();
            var obj2 = new OtherDomainObject();
            obj1.SetId(1);
            obj2.SetId(2);

            bool equality = Equals(obj1, obj2);
            Assert.AreEqual(false, equality);
        }
コード例 #2
0
        public void PersistOtherDomainObject()
        {
            var otherDomainObject = new OtherDomainObject { Name = "Hello World." };
            var otherRepository = new RepositoryWithIntId<OtherDomainObject>(Session);
            using (var transaction = Session.BeginTransaction())
            {
                otherRepository.Insert(otherDomainObject);
                transaction.Commit();
            }

            Assert.IsNotNull(otherDomainObject.Id);
        }