Example #1
0
        public void ShouldGetElementFromLinkedSet()
        {
            LinkedSet <String> list = new LinkedSet <String>();

            list.Add("Fred");
            list.Add("Barney");
            list.Add("Wilma");

            Assert.AreEqual("Barney", ListElementUtil.GetElement(list, 1), "element");
        }
Example #2
0
        public bool Equals(LinkedSet <T> that)
        {
            if (this.list.Count != that.list.Count)
            {
                return(false);
            }
            int count = 0;

            T[] otherList = that.list.ToArray();
            foreach (T item in this.list)
            {
                if (!item.Equals(otherList[count]))
                {
                    return(false);
                }
                count++;
            }

            return(true);
        }