public void GetSessionKeyFor_returns_same_key_for_types_handled_by_the_same_factory()
        {
            var resolver = new NHSessionResolver();
            resolver.RegisterSessionFactoryProvider(() => _ordersFactory);
            resolver.RegisterSessionFactoryProvider(() => _hrFactory);

            var key = resolver.GetSessionKeyFor<Customer>();
            var key2 = resolver.GetSessionKeyFor<Order>();
            Assert.AreEqual(key, key2);
        }
 public void SessionFactoriesRegistered_returns_correct_count()
 {
     var resolver = new NHSessionResolver();
     resolver.RegisterSessionFactoryProvider(() => _ordersFactory);
     resolver.RegisterSessionFactoryProvider(() => _hrFactory);
     Assert.AreEqual(resolver.SessionFactoriesRegistered, 2);
 }
        public void GetSessionFactoryFor_returns_orders_factory_when_requested_for_customer()
        {
            var resolver = new NHSessionResolver();
            resolver.RegisterSessionFactoryProvider(() => _ordersFactory);
            resolver.RegisterSessionFactoryProvider(() => _hrFactory);

            var resolved = resolver.GetFactoryFor<Order>();
            Assert.IsNotNull(resolved);
            Assert.ReferenceEquals(resolved, _ordersFactory);
        }