public async System.Threading.Tasks.Task TestGetAsyncBDD() { JdrDBManager manager = new JdrDBManager(false); //manager.InitJdrDBEntities(); Personnage p = new Personnage("Jordan", "Mage", 0, new Arme("Baton", 0, "pas d'effet", 2), new Armure("Slip", 0, "", 0)); p.AjouterItem(new Divers("Crochet", 12)); p.AjouterItem(new Nouriture("Banane", 2)); await manager.AddAsync((IPersonnage)p); Personnage pRes = manager.GetAsync(p).Result; Assert.Equal(p.Nom, pRes.Nom); }
static void Main(string[] args) { try { using (JdrDBEntities jdrDB = new JdrDBEntities()) { jdrDB.Database.EnsureCreated(); /*foreach (Arme a in Stub.armes()) * { * jdrDB.ArmeSet.Add(a); * }*/ } } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine("Impossible de créer la base"); } Personnage test = new Personnage("hjk", "ghjg", 0, new Arme("", 0, "", 1), new Armure("", 0, "", 0)); Item it = new Arme("Epée courte", 3, "Saignement a 1d100", 1); test.AjouterItem(it); test.AjouterStat(new Stat("PV", 100)); test.AjouterSort(new Sort("Finger of Death", "InstaKill", 999999, 555)); Afficheur.AfficheurPersonnage.afficher(test); Console.ReadLine(); }