public void should_load_entities_only_once()
        {
            //Statistics should be on!
            var myDao = new ProductDao(mySession);

            var myProduct = myDao.GetById(1);
            var sameProductAgain = myDao.GetById(1);

            Assert.That(1 == mySession.Statistics.EntityCount);
        }
Beispiel #2
0
        public void product_category_should_not_be_loaded_before_called()
        {
            var myDao = new ProductDao(mySession);
            var myProduct = myDao.GetById(1);

            var isInitialized = NHibernateUtil.IsInitialized(myProduct.Categories);

            Assert.IsFalse(isInitialized);
        }
Beispiel #3
0
        public void product_category_should_be_loaded_after_called()
        {
            var myDao = new ProductDao(mySession);
            var myProduct = myDao.GetById(1);

            var categoriesCount = myProduct.Categories.Count;

            var isInitialized = NHibernateUtil.IsInitialized(myProduct.Categories);

            Assert.IsTrue(isInitialized);
        }