public void SetupContext()
 {
     ObjectFactory.GetInstance<IMySessionFactory>().ExportSchema();
     _eventArea = new EventArea() { EventName = EventAreaType.Distance };
     _repository = new EventAreaRepository();
     CreateInitialData();
 }
        public void Setup()
        {
            _mockSessionFactory = new Mock<IMySessionFactory>();
            _mockSettingsFactory = new Mock<ISettingsFactory>();
            _session = new Mock<ISession>();
            _transaction = new Mock<ITransaction>();
            _repository = new EventAreaRepository();
            _eventArea = new EventArea();

            Bootstrapper.BootstrapStructureMap();
            ObjectFactory.Inject(typeof(IMySessionFactory), _mockSessionFactory.Object);
            ObjectFactory.Inject(typeof(ISettingsFactory), _mockSettingsFactory.Object);

            _mockSessionFactory.Setup(x => x.OpenSession()).Returns(_session.Object);
            _session.Setup(x => x.BeginTransaction()).Returns(_transaction.Object);
        }