예제 #1
0
        public void KeyValueGetBucket_Success()
        {
            IKeyValueStorage store = new FileKeyValueFileStorage(new EncryptionService(), AppSettingService.Instance);

            store.Put <string>("test", "v11", "data");
            store.Put <string>("test1", "v11", "data");

            Assert.AreEqual(store.GetBuckets().Count, 2);
        }
예제 #2
0
        public void KeyValueDelete_Success()
        {
            IKeyValueStorage store = new FileKeyValueFileStorage(new EncryptionService(), AppSettingService.Instance);

            store.Put <string>("test", "v11", "data");
            Assert.AreEqual(store.Delete("test", "v11"), true);
        }
예제 #3
0
        public void KeyValuePut_Success()
        {
            var dbname = ApplicationConfig.DataBaseName;

            IKeyValueStorage store = new FileKeyValueFileStorage(new EncryptionService(), AppSettingService.Instance);

            Assert.AreEqual(store.Put <string>("test", "v1", "data"), true);
        }
예제 #4
0
        public void KeyValueEmptyGet_Success()
        {
            IKeyValueStorage store = new FileKeyValueFileStorage(new EncryptionService(), AppSettingService.Instance);

            store.Put <string>("test", "v1", "a");


            Assert.AreEqual(string.IsNullOrEmpty(store.Get <string>("test", "v11")), true);
        }
예제 #5
0
        public void KeyValueByteArr_Success()
        {
            IKeyValueStorage store = new FileKeyValueFileStorage(new EncryptionService(), AppSettingService.Instance);

            var data = "data";

            store.Put <byte[]>("test", "v1", Encoding.ASCII.GetBytes(data));

            Assert.AreEqual(Encoding.ASCII.GetString(store.Get <byte[]>("test", "v1")), data);
        }
예제 #6
0
        public void KeyValueGet_Success()
        {
            IKeyValueStorage store = new FileKeyValueFileStorage(new EncryptionService(), AppSettingService.Instance);

            var data = "data";

            store.Put <string>("test", "v1", data);

            Assert.AreEqual(store.Get <string>("test", "v1"), data);
        }
예제 #7
0
        public void KeyValueByteArrEncryption_Success()
        {
            IKeyValueStorage store = new FileKeyValueFileStorage(new EncryptionService(), AppSettingService.Instance);

            var data = "datakhaninChoudhury1212121";

            store.Put <byte[]>("test", "v2", Encoding.ASCII.GetBytes(data), "Encryptionstring%%!&&asdasd!dasd");

            Assert.AreEqual(Encoding.ASCII.GetString(store.Get <byte[]>("test", "v2", "Encryptionstring%%!&&asdasd!dasd")), data);
        }
예제 #8
0
        public void KeyValueDeleteAll_Success()
        {
            IKeyValueStorage store = new FileKeyValueFileStorage(new EncryptionService(), AppSettingService.Instance);

            store.Put <string>("test", "v11", "data");

            foreach (var item in store.GetKeys("test"))
            {
                store.Delete("test", item);
            }
            Assert.AreEqual(store.GetKeys("test").Count, 0);
        }