protected void SetUp()
        {
            ContainerBuilder builder = new ContainerBuilder();
            builder.RegisterType<MD5EncryptionService>().As<IEncryptionService>();
            IContainer container = builder.Build();
            ServiceLocator.Resolver = new AutofacResolver(container);

            _sessionProvider = new SessionProvider("server=.;uid=sa;pwd=truth;Trusted_Connection=no;database=IDDD", typeof(GroupRepository).Assembly);
            this.UserRepository = new UserRepository(_sessionProvider);
            this.GroupRepository = new GroupRepository(_sessionProvider);
            this.TenantRepository = new TenantRepository(_sessionProvider);
            this.RoleRepository = new RoleRepository(_sessionProvider);
            _transaction = Session.BeginTransaction();

            DomainEventPublisher.Instance.Reset();
        }
 public GroupRepository(SessionProvider sessionProvider)
 {
     this._session = sessionProvider.GetSession();
 }
 public TenantRepository(SessionProvider sessionProvider)
 {
     this._session = sessionProvider.GetSession();
 }