Exemple #1
0
        /// <summary>
        /// Registers types
        /// </summary>
        /// <returns>ready set up container</returns>
        private static IUnityContainer ContainerSetup()
        {
            IUnityContainer container = new UnityContainer();

            string engine = ConfigurationManager.AppSettings["DbEngine"];

            switch (engine)
            {
            case "MongoDB":
                container.RegisterType <IWebNoteRepository, MongoDbRepositoryLinq>()
                .RegisterInstance(typeof(DatabaseStartScript), DatabaseStartScript.ForMongoDb());
                break;

            case "Redis":
                container.RegisterType <IWebNoteRepository, RedisRepository>()
                .RegisterInstance(typeof(DatabaseStartScript), DatabaseStartScript.ForRedis());
                break;

            case "RavenDB":
                container.RegisterType <IWebNoteRepository, RavenDbRepository>()
                .RegisterInstance(typeof(DatabaseStartScript), DatabaseStartScript.ForRavenDb());
                break;

            default:
                container.RegisterType <IWebNoteRepository, EntityFrameworkRepository>()
                .RegisterInstance(typeof(DatabaseStartScript), DatabaseStartScript.ForSqlServer());
                break;
            }

            container.RegisterType <DatabaseStartScript>();

            return(container);
        }
        public void StartAndInitialize()
        {
            string importScript = DatabaseStartScript.GetCurrentExecutingDirectory() + @"\..\..\ExplorativeTests\MongoDb\import_logs.cmd";

            Process.Start(new ProcessStartInfo(importScript));

            var client = new MongoClient(ConnectionString);

            server   = client.GetServer();
            database = server.GetDatabase(DatabaseName);
        }
Exemple #3
0
 public ExploratoryTest(DatabaseStartScript script)
 {
     this.script = script;
 }
 // Fire up the server!
 public HowToConnectAndUseMongoDb()
     : base(DatabaseStartScript.ForMongoDb())
 {
 }
 public HowToConnectAndUseRavenDb()
     : base(DatabaseStartScript.ForRavenDb())
 {
 }
Exemple #6
0
 public HowToUseRedisAsCache()
     : base(DatabaseStartScript.ForRedis())
 {
 }
 // Fire up the server!
 public HowToMapReduceWithMongoDb()
     : base(DatabaseStartScript.ForMongoDb())
 {
 }
 public HowToConnectAndUseRedis()
     : base(DatabaseStartScript.ForRedis())
 {
 }
Exemple #9
0
 public HowToMapReduceWithRavenDb()
     : base(DatabaseStartScript.ForRavenDb())
 {
 }
Exemple #10
0
 // Fire up the server!
 public HowToReadAndWriteWithMongoDb()
     : base(DatabaseStartScript.ForMongoDb())
 {
 }