private void AssertNotContainsNull(Collection4 c) { Assert.IsFalse(c.Contains(null)); Assert.IsNull(c.Get(null)); int size = c.Size(); c.Ensure(null); Assert.AreEqual(size + 1, c.Size()); c.Remove(null); Assert.AreEqual(size, c.Size()); }
private void AssertContainsNull(Collection4 c) { Assert.IsTrue(c.Contains(null)); Assert.IsNull(c.Get(null)); var size = c.Size(); c.Ensure(null); Assert.AreEqual(size, c.Size()); }
public virtual void TestGetByIndex() { Collection4 c = new Collection4(); c.Add("one"); c.Add("two"); Assert.AreEqual("one", c.Get(0)); Assert.AreEqual("two", c.Get(1)); AssertIllegalIndex(c, -1); AssertIllegalIndex(c, 2); }
private bool HasIncompatibleTranslatorAspect(Collection4 aspects) { bool translatorFound = false; bool enabledAspectFound = false; int size = aspects.Size(); IAspectVersionContext context = AspectVersionContextImpl.ForSize(size); for (int i = 0; i < size; i++) { ClassAspect current = (ClassAspect)aspects.Get(i); if (!current.IsEnabledOn(context)) { continue; } if (current.IsVirtual()) { continue; } if (current.AspectType() == AspectType.Translator) { translatorFound = true; } else { enabledAspectFound = true; } } return enabledAspectFound && translatorFound; }