public void MemberTest() { var t = RedBlackSet <string> .EmptyTree; var x1 = RedBlackSet <string> .Insert("C", t); var x2 = RedBlackSet <string> .Insert("B", x1); Assert.IsTrue(RedBlackSet <string> .Member("B", x2)); Assert.IsFalse(RedBlackSet <string> .Member("A", x2)); Assert.IsFalse(RedBlackSet <string> .Member("D", x2)); }
private void ReadAction() { var hits = 0; for (var i = 0; i < Count; i++) { var word = NextWord(1); if (RedBlackSet <string> .Member(word, _set)) { hits++; } } Console.WriteLine("Task={0}, Thread={1} : {2} words found", Task.CurrentId, Thread.CurrentThread.ManagedThreadId, hits); }