public void SetUp() { // TODO -- Pull this from the app config var clarify = ClarifyApplication.Initialize(new NameValueCollection { { "fchoice.connectionstring", "Data Source=.; Initial Catalog=mobilecl125; User Id=sa; Password=sa;" }, { "fchoice.dbtype", "mssql" }, { "fchoice.disableloginfromfcapp", "false" }, { "fchoice.sessionpasswordrequired", "false" }, { "fchoice.nocachefile", "true" } }); IClarifySessionUsageReporter reporter; theApplication = new InMemoryClarifyApplication(clarify); var logger = new NulloLogger(); Func <IUserSessionStartObserver> startObserver = () => { reporter = new ClarifySessionUsageReporter(theCache, theApplication, logger); return(new SessionStartObserver(reporter)); }; theCache = new ClarifySessionCache(theApplication, logger, new NulloSessionConfigurator(), () => new SessionEndObserver(), startObserver, new DovetailDatabaseSettings()); theData = new ObjectMother(clarify); theEmployee = theData.GenerateEmployees(1).Single(); theSessionId = theCache.GetSession(theEmployee).Id; theApplication.InvalidateSession(theSessionId); }
public void beforeAll() { //log4net.Config.XmlConfigurator.Configure(new FileInfo("bootstrap.log4net")); _userClarifySessionConfigurator = MockRepository.GenerateStub <IUserClarifySessionConfigurator>(); _clarifyApplication = MockRepository.GenerateStub <IClarifyApplication>(); _userSessionStartObserver = MockRepository.GenerateStub <IUserSessionStartObserver>(); _userSessionEndObserver = MockRepository.GenerateStub <IUserSessionEndObserver>(); _container = bootstrap_ioc.getContainer(c => { }); _container.Configure(c => { c.For <IUserClarifySessionConfigurator>().Use(_userClarifySessionConfigurator); c.For <IClarifyApplication>().Use(_clarifyApplication); c.For <IUserSessionStartObserver>().Use(_userSessionStartObserver); c.For <IUserSessionEndObserver>().Use(_userSessionEndObserver); }); _cut = _container.GetInstance <ClarifySessionCache>(); _settings = _container.GetInstance <DovetailDatabaseSettings>(); //have to create a REAL session because a test fake just won't do _expectedSession = CreateRealSession(); }
public void beforeAll() { _container = bootstrap_ioc.getContainer(c => c.AddRegistry <BootstrapRegistry>()); _cut = _container.GetInstance <ClarifySessionCache>(); }