Sunday, September 7, 2014

Unit Testing NHibernate Caching

I read somewher that says HashtableCacheProvider is more ok on unit testing, somehow true, have to use it for unit testing for now

cfg.Cache(x =>
            {

                // This is more stable on unit test
                x.Provider<NHibernate.Cache.HashtableCacheProvider>();       

                // I don't know why SysCacheProvider has problem on simultaneous unit testing, 
                // might be SysCacheProvider is just giving one session factory, so simultaneous test see each other caches
                // This solution doesn't work: http://stackoverflow.com/questions/700043/mstest-executing-all-my-tests-simultaneously-breaks-tests-what-to-do

                // x.Provider<NHibernate.Caches.SysCache.SysCacheProvider>();                    
                

No comments:

Post a Comment