public void all_other_methods_should_throw_if_not_initialized()
        {
            _uow = new NHibernateUnitOfWork(_sessionSource);

            var flags = BindingFlags.Public | BindingFlags.DeclaredOnly;
            var exception = typeof(InvalidOperationException);

            var methods = typeof(NHibernateUnitOfWork).GetMethods(flags).Where(m => m.Name != "Initialize" && m.Name != "Dispose");

            methods.Each(m =>
            {
                var paramCount = m.GetParameters().Length;
                var methodParams = new object[paramCount];

                paramCount.IterateFromZero(idx => methodParams[idx] = null);

                exception.ShouldBeThrownBy(() => m.Invoke(_uow, methodParams), m.Name);
            });
        }
        public void SetUp()
        {
            _sessionSource = MockRepository.GenerateStub<ISessionSource>();
            _session = MockRepository.GenerateMock<ISession>();
            _transaction = MockRepository.GenerateStub<ITransaction>();

            _sessionSource.Stub(s => s.CreateSession()).Return(_session);
            _session.Stub(s => s.BeginTransaction()).Return(_transaction);

            _uow = new NHibernateUnitOfWork(_sessionSource);
            _uow.Initialize();
        }