示例#1
0
        public void Contains()
        {
            IMultiSet <string> multiSet = new MultiSet <string>();

            multiSet.Add("item1", 3);
            multiSet.Add("item2", 1);
            multiSet.Add(null, 3);

            Assert.IsTrue(multiSet.Contains("item1"));
            Assert.IsTrue(multiSet.Contains("item2"));
            Assert.IsTrue(multiSet.Contains(null));
            Assert.IsFalse(multiSet.Contains("itemNotExist"));
        }
        public void MSNotContains()
        {
            MultiSet <char> mschar = new MultiSet <char>();

            mschar.Add('a');
            Assert.AreEqual(false, mschar.Contains('b'));
        }
        public void MSContains()
        {
            MultiSet <char> mschar = new MultiSet <char>();

            mschar.Add('a');
            Assert.AreEqual(true, mschar.Contains('a'));
        }
        public void StringBuilder_Contains_Method()
        {
            stringBuilderSet = new MultiSet <StringBuilder>();

            stringBuilderSet.Add(a);

            Assert.IsTrue(stringBuilderSet.Contains(a));
        }
        public void Contains_Method()
        {
            multiSet = new MultiSet <char>();

            multiSet.Add('a');

            Assert.IsTrue(multiSet.Contains('a'));
        }