Example #1
0
 public void setHashValueTest()
 {
     createObjectTest();
     API parent = _api;
     data target = new data(parent);
     string obj_type = Constants.TestType;
     string key = Constants.TestHashKey;
     string value = Constants.TestHashValue;
     string prop_name = Constants.TestObjectPropertyName;
     long actual = target.setHashValue(obj_type, key, value, prop_name);
     _hashID = actual;
     //Assert.IsInstanceOfType(actual, typeof(long));
     Assert.IsTrue(actual>0);
     var ret = target.getHashValue(Constants.TestType, Constants.TestHashKey, Constants.TestObjectPropertyName);
     Assert.AreEqual(ret, Constants.TestHashValue);
 }
Example #2
0
 public void removeHashKeysTest()
 {
     //test currently fails with the error:
     //A database error occurred. Please try again: unable to lookup hash keys.	removeHashKeysTest
     setHashValueTest();
     API parent = _api;
     data target = new data(parent);
     string obj_type = Constants.TestType;
     List<string> keys = new List<string>{_hashID.ToString()};
     target.removeHashKeys(obj_type, keys);
     var ret = target.getHashValue(Constants.TestType, Constants.TestHashKey, Constants.TestObjectPropertyName);
     Assert.AreEqual(ret, string.Empty);
 }
Example #3
0
 public void removeHashKeyTest()
 {
     setHashValueTest();
     API parent = _api;
     data target = new data(parent);
     string obj_type = Constants.TestType;
     string key = Constants.TestHashKey;
     target.removeHashKey(obj_type, key);
     var ret = target.getHashValue(Constants.TestType, Constants.TestHashKey, Constants.TestObjectPropertyName);
     Assert.AreEqual(ret, string.Empty);
 }
Example #4
0
 public void getHashValueTest()
 {
     setHashValueTest();
     API parent = _api;
     data target = new data(parent);
     string obj_type = Constants.TestType;
     string key = Constants.TestHashKey;
     string prop_name = Constants.TestObjectPropertyName;
     string expected = Constants.TestHashValue;
     string actual;
     actual = target.getHashValue(obj_type, key, prop_name);
     Assert.AreEqual(expected, actual);
 }