public void TestInitialize()
        {
            base.Setup();

            // Instanciate the manager only 1 time
            if (CouchBaseLiteLiteManager == null)
            {
                CouchBaseLiteLiteManager = Mvx.Resolve <ICouchBaseLite>();
            }

            // Add Sqlite plugin register. Do it only for unit tests (https://github.com/CouchBaseLite/CouchBaseLite-lite-net/wiki/Error-Dictionary#cblcs0001)
            //CouchBaseLite.Lite.Storage.SystemSQLite.Plugin.Register();

            entityRepo           = new CouchBaseLiteRepository <TestEntity>(CouchBaseLiteLiteManager, dbName);
            entityRepo2          = new CouchBaseLiteRepository <TestEntity>(CouchBaseLiteLiteManager, dbName);
            collectionEntityRepo = new CouchBaseLiteRepository <CollectionTest>(CouchBaseLiteLiteManager, dbName);
            entityExtraEltRepo   = new CouchBaseLiteRepository <TestExtraEltEntity>(CouchBaseLiteLiteManager, dbName);

            // Define mapping for polymorphism
            entityRepo.PolymorphicTypes["TestExtraEltEntity"]  = typeof(TestExtraEltEntity);
            entityRepo2.PolymorphicTypes["TestExtraEltEntity"] = typeof(TestExtraEltEntity);

            test = new NoSQLCoreUnitTests(entityRepo,
                                          entityRepo2,
                                          entityExtraEltRepo,
                                          collectionEntityRepo,
                                          NoSQLCoreUnitTests.testContext.DeploymentDirectory,
                                          dbName);
        }
        public static void ClassInitialize(TestContext testContext)
        {
            NoSQLCoreUnitTests.ClassInitialize(testContext);

            RegisterMongoMapping <TestEntity>();

            runner = MongoDbRunner.Start();
        }
        public void TestInitialize()
        {
            var dbName = "NoSQLTestDb";

            // Add Sqlite plugin register. Do it only for unit tests (https://github.com/CouchBaseLite/CouchBaseLite-lite-net/wiki/Error-Dictionary#cblcs0001)
            //CouchBaseLite.Lite.Storage.SystemSQLite.Plugin.Register();

            var entityRepo           = new JsonFileRepository <TestEntity>(NoSQLCoreUnitTests.testContext.DeploymentDirectory, dbName);
            var entityRepo2          = new JsonFileRepository <TestEntity>(NoSQLCoreUnitTests.testContext.DeploymentDirectory, dbName);
            var collectionEntityRepo = new JsonFileRepository <CollectionTest>(NoSQLCoreUnitTests.testContext.DeploymentDirectory, dbName);
            var entityExtraEltRepo   = new JsonFileRepository <TestExtraEltEntity>(NoSQLCoreUnitTests.testContext.DeploymentDirectory, dbName);

            test = new NoSQLCoreUnitTests(entityRepo, entityRepo2, entityExtraEltRepo, collectionEntityRepo,
                                          NoSQLCoreUnitTests.testContext.DeploymentDirectory, dbName);
        }
Beispiel #4
0
        public void TestInitialize()
        {
            var dbName = "NoSQLTestDb";

            // Add Sqlite plugin register. Do it only for unit tests (https://github.com/CouchBaseLite/CouchBaseLite-lite-net/wiki/Error-Dictionary#cblcs0001)
            //CouchBaseLite.Lite.Storage.SystemSQLite.Plugin.Register();
            Couchbase.Lite.Support.NetDesktop.Activate();

            var entityRepo  = new CouchBaseLiteRepository <TestEntity>(Directory.GetCurrentDirectory(), dbName);
            var entityRepo2 = new CouchBaseLiteRepository <TestEntity>(Directory.GetCurrentDirectory(), dbName);
            //var collectionEntityRepo = new CouchBaseLiteRepository<CollectionTest>(Directory.GetCurrentDirectory(), dbName);
            var entityExtraEltRepo = new CouchBaseLiteRepository <TestExtraEltEntity>(Directory.GetCurrentDirectory(), dbName);

            test = new NoSQLCoreUnitTests(entityRepo, entityRepo2, entityExtraEltRepo, Directory.GetCurrentDirectory(), dbName);
        }
        public void TestInitialize()
        {
            var databaseName = "UnitTstsNoSqlRepo";

            entityRepo         = new MongoDbRepository <TestEntity>(runner.ConnectionString, databaseName);
            entityRepo2        = new MongoDbRepository <TestEntity>(runner.ConnectionString, databaseName);
            entityExtraEltRepo = new MongoDbRepository <TestExtraEltEntity>(runner.ConnectionString, databaseName);

            // Define mapping for polymorphism
            //entityRepo.PolymorphicTypes["TestExtraEltEntity"] = typeof(TestExtraEltEntity);
            //entityRepo2.PolymorphicTypes["TestExtraEltEntity"] = typeof(TestExtraEltEntity);

            test = new NoSQLCoreUnitTests(entityRepo, entityRepo2, entityExtraEltRepo,
                                          Directory.GetCurrentDirectory(), databaseName);
        }
Beispiel #6
0
 public static void ClassInitialize(TestContext testContext)
 {
     NoSQLCoreUnitTests.ClassInitialize(testContext);
 }
 public static void ClassInitialize(TestContext testContext)
 {
     CouchBaseLiteRepUnitTest.testContext = testContext;
     NoSQLCoreUnitTests.ClassInitialize(testContext);
 }