Exemplo n.º 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));
        }
Exemplo n.º 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"));
        }
Exemplo n.º 3
0
 public CoreTests()
 {
     StoragePaths.CleanRoots();
     StoragePath = StoragePaths.CreateStorageFolder();
 }
Exemplo n.º 4
0
 public FileStoreTests()
 {
     StoragePaths.CleanRoots();
     StoragePath1 = StoragePaths.CreateStorageFolder();
     StoragePath2 = StoragePaths.CreateStorageFolder();
 }