public void GetIdFromEmptyList() { var idList = new List <IId>(); var idSetter = new IdSetter(idList); Assert.AreEqual(idSetter.getId(), 0); }
public void GetIdAfterAdding() { var idList = this.CreateIdList(1); var idSetter = new IdSetter(idList); Assert.AreEqual(idSetter.getId(), 1); }
private void AddToList(ref List <IId> idList) { var player = new Player(); var idSetter = new IdSetter(idList); player.Id = idSetter.getId(); idList.Add(player); }
public void Add(Team newPlayer) { var idControler = new IdSetter(this.Teams.OfType <IId>().ToList <IId>()); int newId = idControler.getId(); newPlayer.Id = newId; Console.WriteLine("NEW ID IS : {0}", newId); this.Teams.Add(newPlayer); }
public void GetIdAfterRemovingLast() { var idList = this.CreateIdList(20); idList.RemoveAt(19); var idSetter = new IdSetter(idList); Assert.AreEqual(idSetter.getId(), 19); }
public void GetIdAfterRemovingInTheMiddleOfList() { var idList = this.CreateIdList(30); idList.RemoveAt(15); var TestIdSetter = new IdSetter(idList); Assert.AreEqual(TestIdSetter.getId(), 15); }
public void GetIdAfterRemovingFirst() { var idList = this.CreateIdList(30); idList.RemoveAt(0); var TestIdSetter = new IdSetter(idList); Assert.AreEqual(TestIdSetter.getId(), 0); }
public void GetIdAfterPlacingSomeElementsInTheMiddle() { var idList = this.CreateIdList(30); idList.RemoveAt(14); idList.RemoveAt(14); idList.RemoveAt(14); this.AddToList(ref idList); this.AddToList(ref idList); var TestIdSetter = new IdSetter(idList); Assert.AreEqual(TestIdSetter.getId(), 16); }