public virtual void testEquals() { Assert.IsTrue(ContainerUtil.Equals(null, null)); Assert.IsFalse(ContainerUtil.Equals(null, "")); Assert.IsFalse(ContainerUtil.Equals("", null)); Assert.IsFalse(ContainerUtil.Equals("", " ")); Assert.IsTrue(ContainerUtil.Equals("a", "a")); }
public virtual void testToHashSetArray() { string[] a = { "a", "b" }; SupportClass.SetSupport <string> s = ContainerUtil.toHashSet(a); Assert.IsTrue(s.Contains("a")); Assert.IsTrue(s.Contains("b")); Assert.IsFalse(s.Contains("c")); Assert.AreEqual(s.Count, a.Length); }
public virtual void testGetMatch() { List <SimpleMatch> v = new List <SimpleMatch>(); for (int i = 0; i < 10; i++) { v.Add(new SimpleMatch(i % 2)); } SimpleMatch simpleMatch1 = new SimpleMatch(1); Assert.AreEqual(5, ContainerUtil.getMatches(v, simpleMatch1).Count); Assert.AreEqual(simpleMatch1, ContainerUtil.getMatch(v, simpleMatch1, 0)); }
public virtual void testToValueVector() { Dictionary <string, string> hm = new Dictionary <string, string>(); for (int i = 0; i < 10; i++) { hm.Add("" + i, "a" + i); } List <string> v = ContainerUtil.toValueVector(hm, false); Assert.AreEqual(v.Count, 10); VString vString = new VString(v); List <string> vs = ContainerUtil.toValueVector(hm, true); VString vsString = new VString(vs); Assert.IsTrue(vsString.ContainsAll(vString)); Assert.IsTrue(vString.ContainsAll(vsString)); for (int i = 1; i < 10; i++) { Assert.IsTrue(vs[i - 1].CompareTo(vs[i]) < 0); } }
// (non-Javadoc) // } // * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) // public virtual int Compare(JDFDate d0, JDFDate d1) { return(ContainerUtil.compare(d0, d1)); }