示例#1
0
        public void ObjectCreation_CreateWithValues_ValuesExist()
        {
            ConcurrentList <string> theList;

            theList = new ConcurrentList <string>();
            for (int i = 0; i < 6; i++)
            {
                theList.Add(TestDataTestHelper.GetString());
            }

            Assert.AreEqual(6, theList.Count);
        }
示例#2
0
        public void ListOperation_AddRemoveItems_IsValidCount()
        {
            ConcurrentList <string> theList;

            theList = new ConcurrentList <string>();
            Assert.AreEqual(0, theList.Count);

            for (int i = 0; i < 3; i++)
            {
                theList.Add(TestDataTestHelper.GetString());
                Assert.AreEqual(i + 1, theList.Count);
            }

            for (int i = theList.Count; i > 0; i--)
            {
                theList.Remove(theList[i - 1]);
                Assert.AreEqual(i - 1, theList.Count);
            }
        }
示例#3
0
        public void ObjectCreation_CreateWithValues_ValuesAreValid()
        {
            ConcurrentList <string> theList;

            string[] values;

            values = TestDataTestHelper.GetStrings();

            theList = new ConcurrentList <string>();
            for (int i = 0; i < values.Length; i++)
            {
                theList.Add(values[i]);
            }

            Assert.AreEqual(values.Length, theList.Count);
            for (int i = 0; i < values.Length; i++)
            {
                Assert.IsTrue(theList.Contains(values[i]));
            }
        }