예제 #1
0
        public async System.Threading.Tasks.Task TestCreateBddAsync()
        {
            JdrDBManager manager = new JdrDBManager(true);
            IPersonnage  p       = new Personnage("Jordan", "Mage", 0, new BiblioJdr.Arme("Baton", 0, "pas d'effet", 2), new BiblioJdr.Armure("Slip", 0, "", 0));
            await manager.AddAsync(p);

            Assert.IsNotNull(manager.GetAsync(p));
        }
예제 #2
0
        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);
        }