Example #1
0
        static void AddValueTypeTestSub(bool trackFree)
        {
            const int o1 = new int();
            const int o2 = new int();
            var d = new DArray<object>(trackFree) { o1, o2 };

            Assert.IsTrue(d.Contains(o1), "TrackFree = " + trackFree);
            Assert.IsTrue(d.Contains(o2), "TrackFree = " + trackFree);
            Assert.AreEqual(2, d.Length, "TrackFree = " + trackFree);
        }
Example #2
0
        static void AddTestSub(bool trackFree)
        {
            var o1 = new object();
            var o2 = new object();
            var d = new DArray<object>(trackFree) { o1, o2 };

            Assert.IsTrue(d.Contains(o1), "TrackFree = " + trackFree);
            Assert.IsTrue(d.Contains(o2), "TrackFree = " + trackFree);
            Assert.AreEqual(2, d.Length, "TrackFree = " + trackFree);
        }
Example #3
0
        static void AddValueTypeTestSub(bool trackFree)
        {
            const int o1 = new int();
            const int o2 = new int();
            var       d  = new DArray <object>(trackFree)
            {
                o1, o2
            };

            Assert.IsTrue(d.Contains(o1), "TrackFree = " + trackFree);
            Assert.IsTrue(d.Contains(o2), "TrackFree = " + trackFree);
            Assert.AreEqual(2, d.Length, "TrackFree = " + trackFree);
        }
Example #4
0
        static void AddTestSub(bool trackFree)
        {
            var o1 = new object();
            var o2 = new object();
            var d  = new DArray <object>(trackFree)
            {
                o1, o2
            };

            Assert.IsTrue(d.Contains(o1), "TrackFree = " + trackFree);
            Assert.IsTrue(d.Contains(o2), "TrackFree = " + trackFree);
            Assert.AreEqual(2, d.Length, "TrackFree = " + trackFree);
        }
Example #5
0
        static void RemoveTestSub(bool trackFree)
        {
            var d = new DArray <object>(trackFree);

            for (var i = 0; i < 10; i++)
            {
                d[i] = new object();
            }

            var o = d[5];

            Assert.IsTrue(d.Remove(o));
            Assert.IsFalse(d.Contains(o));
        }
Example #6
0
        static void ContainsTestSub(bool trackFree)
        {
            const int size = 10;

            var d = new DArray <object>(trackFree);

            for (var i = 0; i < size; i++)
            {
                d[i] = new object();
            }

            for (var i = 0; i < size; i++)
            {
                Assert.IsTrue(d.Contains(d[i]));
            }
        }
 /// <summary>
 /// Determines whether the <see cref="T:System.Collections.Generic.ICollection`1"/> contains a specific value.
 /// </summary>
 /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <returns>
 /// true if <paramref name="item"/> is found in the <see cref="T:System.Collections.Generic.ICollection`1"/>;
 /// otherwise, false.
 /// </returns>
 public bool Contains(IQuestDescription item)
 {
     return(_questDescriptions.Contains(item));
 }
Example #8
0
        static void ContainsTestSub(bool trackFree)
        {
            const int size = 10;

            var d = new DArray<object>(trackFree);
            for (var i = 0; i < size; i++)
            {
                d[i] = new object();
            }

            for (var i = 0; i < size; i++)
            {
                Assert.IsTrue(d.Contains(d[i]));
            }
        }
Example #9
0
        static void RemoveTestSub(bool trackFree)
        {
            var d = new DArray<object>(trackFree);

            for (var i = 0; i < 10; i++)
            {
                d[i] = new object();
            }

            var o = d[5];
            Assert.IsTrue(d.Remove(o));
            Assert.IsFalse(d.Contains(o));
        }