예제 #1
0
        public void SetUp()
        {
            app = new Application(new Type[0]);

            storageMock = new Mock <ISessionStorage>();
            session     = new SessionOverStorage(storageMock.Object, 42);
            app.Instance <ISession>(session);

            Facade.SetApplication(app);
        }
        private void PerformContainerSurgery(Application serverApp)
        {
            // replace the database instance
            var arangoRepo = clientApp.Resolve <ArangoRepository>();

            arango = arangoRepo.GetDatabase(
                clientApp.Preferences.EmulatedDatabaseName
                );
            serverApp.Instance <IArango>(arango);
            clientApp.DontDisposeInstance(arango);

            // replace session instance
            var session = new SessionOverStorage(
                new EmulatedSessionStorage(arango),
                3600
                );

            serverApp.Instance <ISession>(session);
        }