コード例 #1
0
        protected override void AdditionalSetup()
        {
            base.AdditionalSetup();

            var fileStore = new MvxWpfFileStore(NoSQLCoreUnitTests.testContext.DeploymentDirectory + "\\");

            Ioc.RegisterSingleton <IMvxFileStore>(fileStore);
        }
コード例 #2
0
        protected override void AdditionalSetup()
        {
            base.AdditionalSetup();

            var fileStore = new MvxWpfFileStore(NoSQLCoreUnitTests.testContext.DeploymentDirectory + "\\");

            Ioc.RegisterSingleton <IMvxFileStore>(fileStore);

            Ioc.RegisterSingleton <ICouchBaseLite>(
                () =>
            {
                var cbl = new CouchBaseLite();
                cbl.Initialize(NoSQLCoreUnitTests.testContext.DeploymentDirectory + "\\DB");
                return(cbl);
            }
                );
        }
コード例 #3
0
        public void MvvX_CBLite_NewBaseTests()
        {
            var dbFolderPath = Path.Combine(NoSQLCoreUnitTests.testContext.DeploymentDirectory, "DB2");
            var fileStore    = new MvxWpfFileStore(dbFolderPath);

            // Ensure that the db file doesn't exists
            if (fileStore.FolderExists(dbFolderPath))
            {
                fileStore.DeleteFolder(dbFolderPath, true);
            }

            var cbl = new CouchBaseLite();

            cbl.Initialize(dbFolderPath);

            // Create a new db (the db file is missing)
            entityRepo = new CouchBaseLiteRepository <TestEntity>(CouchBaseLiteLiteManager, "DB2");

            Assert.AreEqual(false, entityRepo.Exist("123456"));
        }