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(); }
public void TestCasterSortDegats() { Sort leSort = new Sort("test", "test", 1, 30); Personnage p = new Personnage("Karjo", "Fail", 0, new Arme("", 0, "", 0), new Armure("", 0, "", 1)); p.AjouterStat(new Stat("Mana", 100)); p.AjouterSort(leSort); Ennemi e = new Ennemi("Evil karjo", new Arme("a", 5, "rien", 1)); e.AjouterStat(new Stat("PV", 100)); p.CasterSort(leSort, e); Assert.AreEqual(99, e.FindStat("PV").Valeur); }