public void SimpleLargeList() { Key key = new Key(args.ns, args.set, "setkey"); // Delete record if it already exists. client.Delete(null, key); // Initialize large set operator. LargeList llist = client.GetLargeList(null, key, binName); string orig1 = "llistValue1"; string orig2 = "llistValue2"; string orig3 = "llistValue3"; // Write values. llist.Add(Value.Get(orig1)); llist.Add(Value.Get(orig2)); llist.Add(Value.Get(orig3)); // Perform a Range Query -- look for "llistValue2" to "llistValue3" IList rangeList = llist.Range(Value.Get(orig2), Value.Get(orig3)); Assert.IsNotNull(rangeList); Assert.AreEqual(2, rangeList.Count); string v2 = (string)rangeList[0]; string v3 = (string)rangeList[1]; Assert.AreEqual(orig2, v2); Assert.AreEqual(orig3, v3); // Remove last value. llist.Remove(Value.Get(orig3)); int size = llist.Size(); Assert.AreEqual(2, size); IList listReceived = llist.Find(Value.Get(orig2)); string expected = orig2; Assert.IsNotNull(listReceived); string stringReceived = (string)listReceived[0]; Assert.IsNotNull(stringReceived); Assert.AreEqual(expected, stringReceived); }
public void SimpleLargeList() { if (!args.ValidateLDT()) { return; } Key key = new Key(args.ns, args.set, "setkey"); // Delete record if it already exists. client.Delete(null, key); // Initialize large set operator. LargeList llist = client.GetLargeList(null, key, binName); string orig1 = "llistValue1"; string orig2 = "llistValue2"; string orig3 = "llistValue3"; // Write values. llist.Add(Value.Get(orig1)); llist.Add(Value.Get(orig2)); llist.Add(Value.Get(orig3)); // Perform exists. bool b = llist.Exists(Value.Get(orig2)); Assert.IsTrue(b); b = llist.Exists(Value.Get("notfound")); Assert.IsFalse(b); // Test record not found. LargeList nflist = client.GetLargeList(null, new Key(args.ns, args.set, "sfdfdqw"), binName); b = nflist.Exists(Value.Get(orig2)); Assert.IsFalse(b); IList klist = new List <Value>(); klist.Add(Value.Get(orig2)); klist.Add(Value.Get(orig1)); klist.Add(Value.Get("notfound")); IList <bool> blist = llist.Exists(klist); Assert.IsTrue(blist[0]); Assert.IsTrue(blist[1]); Assert.IsFalse(blist[2]); // Test record not found. IList <bool> blist2 = nflist.Exists(klist); Assert.IsFalse(blist2[0]); Assert.IsFalse(blist2[1]); Assert.IsFalse(blist2[2]); // Perform a Range Query -- look for "llistValue2" to "llistValue3" IList rangeList = llist.Range(Value.Get(orig2), Value.Get(orig3)); Assert.IsNotNull(rangeList); Assert.AreEqual(2, rangeList.Count); string v2 = (string)rangeList[0]; string v3 = (string)rangeList[1]; Assert.AreEqual(orig2, v2); Assert.AreEqual(orig3, v3); // Remove last value. llist.Remove(Value.Get(orig3)); int size = llist.Size(); Assert.AreEqual(2, size); IList listReceived = llist.Find(Value.Get(orig2)); string expected = orig2; Assert.IsNotNull(listReceived); string stringReceived = (string)listReceived[0]; Assert.IsNotNull(stringReceived); Assert.AreEqual(expected, stringReceived); }