public void TestAddProduit()
        {
            Controleur controleur = new CommandeControleur();

            controleur.CreerProduit("Téléphone portable de type bien", 666);
            Assert.AreEqual("Téléphone portable de type bien", controleur.GetProduits().Last().Designation);
            Assert.AreEqual(666, controleur.GetProduits().Last().Prix);
        }
Example #2
0
        public void AjoutProduitOK()
        {
            Controleur controler = new CommandeControleur();

            controler.CreerProduit("Tournevis", 12);
            Assert.AreEqual("Tournevis", controler.GetProduits().Last().Designation);
            Assert.AreEqual(12, controler.GetProduits().Last().Prix);
        }
Example #3
0
        public void CreerProduit()
        {
            Controleur controleur = new CommandeControleur();

            controleur.CreerProduit("Banane", 15);
            Assert.AreEqual(controleur.GetProduits().Last().Designation, "Banane");
            Assert.AreEqual(controleur.GetProduits().Last().Prix, 15);
        }
Example #4
0
        public void TestCreateProduitOk()
        {
            Controleur ctrl = new CommandeControleur();

            ctrl.CreerProduit("Chimichangas", 20);

            Assert.AreEqual("Chimichanga", ctrl.GetProduits().Last().Designation);
            Assert.AreEqual(20, ctrl.GetProduits().Last().Prix);
        }
        public void TestCreerProduit()
        {
            Controleur controleur = new CommandeControleur();

            controleur.CreerProduit("Jambe", 10);

            Assert.AreEqual("Jambe", controleur.GetProduits().Last().Designation);
            Assert.AreEqual(10, controleur.GetProduits().Last().Prix);
        }
Example #6
0
        public void CreerProduitOK()
        {
            Controleur controller = new CommandeControleur();
            ProduitDao produit    = new ProduitDao();
            int        un         = produit.Produits.Count();

            controller.CreerProduit("Nintendo Switch", 299);
            Assert.AreEqual(controller.GetProduits().Last().Id, un + 1);                     // Vérifier que l'ID est bien augmenté de 1.
            Assert.AreEqual(controller.GetProduits().Last().Designation, "Nintendo Switch"); // Vérifier que la désignation est bien insérée et correcte
            Assert.AreEqual(controller.GetProduits().Last().Prix, 299);                      // Vérifier que le prix est bien inséré et correct
        }
Example #7
0
        public void TestAjoutProduit()
        {
            CommandeControleur ctrl = new CommandeControleur();

            Produit p = new Produit();

            p.Designation = "String XL";
            p.Prix        = 15;

            ctrl.CreerProduit(p.Designation, p.Prix);
            Assert.AreEqual("String XL", ctrl.GetProduits().Last().Designation);
        }
Example #8
0
        public void TestAjoutProduitOk()
        {
            Controleur c1        = new CommandeControleur();
            ProduitDao produit   = new ProduitDao();
            int        unproduit = produit.Produits.Count();

            c1.CreerProduit("Iphone", "749");
            Assert.AreEqual(c1.GetProduits().Last().Id, unproduit + 1);
            Assert.AreEqual(c1.GetProduits().Last().Designation, "Iphone");
            Assert.AreEqual(c1.GetProduits().Last().Prix, "749");
            //J'ajoute un produit avec une désignation et un prix et je vérifie si le dernier produit ajouté est bien égal aux informations
            //concernant l'ajout du produit
        }
Example #9
0
        public void TestCreateCommandeOk()
        {
            Controleur ctrl = new CommandeControleur();

            ctrl.CreerClient("Wilson", "Wade", "*****@*****.**");
            ctrl.CreerProduit("Chimichanga", 20);

            List <LigneCommande> lgCmd = new List <LigneCommande>();

            lgCmd.Add(new LigneCommande()
            {
                Produit = ctrl.GetProduits().Last(), Quantite = 1
            });

            ctrl.CreerCommande(ctrl.GetClients().Last(), lgCmd);

            Assert.AreEqual(ctrl.GetClients().Last(), ctrl.GetCommandes().Last().Client);
            Assert.AreEqual(lgCmd, ctrl.GetCommandes().Last().LignesCommande);
        }