public void Insert_IntoIndex5_ThrowException() { //arrange string test = "Exception"; AList <string> listOfValues = new AList <string>(); listOfValues.Add("fill"); listOfValues.Add("fill"); //act listOfValues.Insert(5, test); //assert }
public void Insert_PutValueAtIndex0_AListIndex1IsThere() { //arrange string item = "Expected value"; AList <string> listOfValues = new AList <string>(); listOfValues.Add(item); //act listOfValues.Insert(0, "fill"); //assert Assert.AreEqual(listOfValues[1], item); }
public virtual void AddColumnItems(int column, IList <ICell> cellColumnItems) { // It should be same size with exist model list. if (cellColumnItems.Count != mItemList.Count || cellColumnItems.Contains(null)) { return; } // Firstly, add columns from visible recyclerViews. // To be able provide removing animation, we need to notify just for given column position. CellLayoutManager layoutManager = mTableView.GetCellLayoutManager(); for (int i = layoutManager.FindFirstVisibleItemPosition(); i < layoutManager.FindLastVisibleItemPosition() + 1; i++) { // Get the cell row recyclerView that is located on i position RecyclerView cellRowRecyclerView = (RecyclerView)layoutManager.FindViewByPosition(i); // Add the item using its adapter. ((AbstractRecyclerViewAdapter <ICell>)cellRowRecyclerView.GetAdapter()).AddItem(column, cellColumnItems[i]); } // Lets change the model list silently IList <IList <ICell> > cellItems = new AList <IList <ICell> >(); for (int i_1 = 0; i_1 < mItemList.Count; i_1++) { IList <ICell> rowList = new AList <ICell>((IList <ICell>)mItemList[i_1]); if (rowList.Count > column) { rowList.Insert(column, cellColumnItems[i_1]); } cellItems.Add(rowList); } // Change data without notifying. Because we already did for visible recyclerViews. SetItems(cellItems, false); }
protected override int Add(AList <int> alist, int item, int preferredIndex) { alist.Insert(preferredIndex, item); return(preferredIndex); }
private TypeName TypeNameFromCCIType(CCI.TypeNode type) { while (type.Template != null) type = type.Template; var types = new AList<string>(); types.Add(type.Name.Name); while (type.DeclaringType != null) { type = type.DeclaringType; types.Insert(0, type.Name.Name); } var ns = default(IImAList<string>); if (type.Namespace != null && !string.IsNullOrEmpty(type.Namespace.Name)) { if (!namespaceCache.TryGetValue(type.Namespace.Name, out ns)) { ns = new AList<string>(type.Namespace.Name.Split('.')); namespaceCache.Add(type.Namespace.Name, ns); } } return new TypeName(ns, types); }