예제 #1
0
        public void CantSetGeneratorAssigned()
        {
            var hbmId = new HbmCollectionId();
            var collectionIdMapper = new CollectionIdMapper(hbmId);

            Assert.That(() => collectionIdMapper.Generator(Generators.Assigned), Throws.TypeOf <NotSupportedException>());
        }
예제 #2
0
        public void WhenForceTypeThenNotChangeType()
        {
            var hbmId = new HbmCollectionId();
            var collectionIdMapper = new CollectionIdMapper(hbmId);

            collectionIdMapper.Type((IIdentifierType)NHibernateUtil.Int64);
            collectionIdMapper.Generator(Generators.HighLow);

            Assert.That(hbmId.generator.@class, Is.EqualTo("hilo"));
            Assert.That(hbmId.type, Is.EqualTo("Int64"));
        }