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); }
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); }
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); }
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); }
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)); }
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)); }
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])); } }
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)); }