Example #1
0
        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);
        }
Example #2
0
            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();
            }
Example #3
0
        public void beforeAll()
        {
            _container = bootstrap_ioc.getContainer(c => c.AddRegistry <BootstrapRegistry>());

            _cut = _container.GetInstance <ClarifySessionCache>();
        }