using BowlingLib.Model; using BowlingLib.Interface; using System; public class StubJoueur : IDataManager { private List listJoueurs = new List(); public void Add(Joueur data) { listJoueurs.Add(data); } public void Delete(Joueur data) { listJoueurs.Remove(data); } public IEnumerable GetAll() { return listJoueurs; } public IEnumerable GetAll(int n=10, int j=0) { for (int i = 0; i < n; i++) { Add(new Joueur("Joueur " + i + 1)); } return listJoueurs; } public void Update(Joueur data) { int index = listJoueurs.FindIndex(x => x.Id == data.Id); listJoueurs[index] = data; } }