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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }