public void testEmptyBuilder() { RefList <global::GitSharp.Core.Ref> list = new RefList <global::GitSharp.Core.Ref> .Builder <global::GitSharp.Core.Ref>().toRefList(); Assert.AreEqual(0, list.size()); Assert.IsFalse(list.iterator().hasNext()); Assert.AreEqual(-1, list.find("a")); Assert.AreEqual(-1, list.find("z")); Assert.IsFalse(list.contains("a")); Assert.IsNull(list.get("a")); Assert.IsTrue(list.asList().Count == 0); Assert.AreEqual("[]", list.ToString()); // default array capacity should be 16, with no bounds checking. Assert.IsNull(list.get(16 - 1)); try { list.get(16); Assert.Fail("default RefList should have 16 element array"); } catch (IndexOutOfRangeException) { // expected } }
protected RefWriter(RefList <Ref> list) { refs = list.asList(); }
protected RefWriter(RefList<Ref> list) { refs = list.asList(); }
public void testEmptyBuilder() { RefList<global::GitSharp.Core.Ref> list = new RefList<global::GitSharp.Core.Ref>.Builder<global::GitSharp.Core.Ref>().toRefList(); Assert.AreEqual(0, list.size()); Assert.IsFalse(list.iterator().hasNext()); Assert.AreEqual(-1, list.find("a")); Assert.AreEqual(-1, list.find("z")); Assert.IsFalse(list.contains("a")); Assert.IsNull(list.get("a")); Assert.IsTrue(list.asList().Count == 0); Assert.AreEqual("[]", list.ToString()); // default array capacity should be 16, with no bounds checking. Assert.IsNull(list.get(16 - 1)); try { list.get(16); Assert.Fail("default RefList should have 16 element array"); } catch (IndexOutOfRangeException err) { // expected } }
private RefList <Ref> upcast <TRef>(RefList <TRef> loose) where TRef : Ref { var list = new List <Ref>(loose.asList()); return(new RefList <Ref>(list.ToArray(), list.Count)); }