示例#1
0
        public void TextTest()
        {
            var rootPath = StoragePaths.CreateStorageFolder();

            var _store = FileStore.GetStore(rootPath);

            long docId = _store.StoreText("the content");

            Assert.Equal("the content", _store.LoadText(docId));
        }
示例#2
0
        public void Id_Generateor_Tests()
        {
            var storagePath = StoragePaths.CreateStorageFolder();
            var core        = new Core(storagePath);

            // generating ids in root without any clusters
            Assert.Equal(1, core.GetNewStoreId());
            Assert.Equal(2, core.GetNewStoreId());

            // generating ids in `news` cluster
            Assert.Equal(1, core.GetNewStoreId("news"));
            Assert.Equal(2, core.GetNewStoreId("news"));
            Assert.Equal(3, core.GetNewStoreId("news"));
            Assert.Equal(4, core.GetNewStoreId("news"));

            // generating ids in `articles` cluster
            Assert.Equal(1, core.GetNewStoreId("articles"));
            Assert.Equal(2, core.GetNewStoreId("articles"));
            Assert.Equal(3, core.GetNewStoreId("articles"));
        }
示例#3
0
 public CoreTests()
 {
     StoragePaths.CleanRoots();
     StoragePath = StoragePaths.CreateStorageFolder();
 }
示例#4
0
 public FileStoreTests()
 {
     StoragePaths.CleanRoots();
     StoragePath1 = StoragePaths.CreateStorageFolder();
     StoragePath2 = StoragePaths.CreateStorageFolder();
 }