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); }
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); }
public void CreerProduit() { Controleur controleur = new CommandeControleur(); controleur.CreerUnProduit("Carotte", 500); Assert.AreEqual(controleur.GetProduits().Last().Designation, "Carotte"); Assert.AreEqual(controleur.GetProduits().Last().Prix, 500); }
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); }
public void AjoutClientOK() { Controleur control = new CommandeControleur(); control.CreerClient("Moriceau", "Alexis", "*****@*****.**"); Assert.AreEqual("Moriceau", control.GetClients().Last().Nom); Assert.AreEqual("Alexis", control.GetClients().Last().Prenom); Assert.AreEqual("*****@*****.**", control.GetClients().Last().Mail); }
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); }
public void TestAddClient() { Controleur controleur = new CommandeControleur(); controleur.CreerClient("Langer", "Bebel", "*****@*****.**"); Assert.AreEqual("Langer", controleur.GetClients().Last().Nom); Assert.AreEqual("Bebel", controleur.GetClients().Last().Prenom); Assert.AreEqual("*****@*****.**", controleur.GetClients().Last().Mail); }
static void Main(string[] args) { Controleur controleur = new CommandeControleur(); MainVue vue = new MainVue(controleur); ICollection <Client> Clients = new Collection <Client>(); vue.start(); }
public void CreerClient() { Controleur controleur = new CommandeControleur(); controleur.CreerClient("Crastes", "Janou", "*****@*****.**"); Assert.AreEqual(controleur.GetClients().Last().Prenom, "Janou"); Assert.AreEqual(controleur.GetClients().Last().Nom, "Crastes"); Assert.AreEqual(controleur.GetClients().Last().Mail, "*****@*****.**"); }
public void CreerCommande() { Controleur controleur = new CommandeControleur(); List <LigneCommande> Produit = new List <LigneCommande>(); controleur.CreerCommande(controleur.GetClients().Last(), Produit); Assert.AreEqual(controleur.GetCommandes().Last().LignesCommande, Produit); Assert.AreEqual(controleur.GetCommandes().Last().Client, controleur.GetClients().Last()); }
public void CreerClient() { Controleur controleur = new CommandeControleur(); controleur.CreerClient("Besseau", "William", "*****@*****.**"); Assert.AreEqual(controleur.GetClients().Last().Nom, "Besseau"); Assert.AreEqual(controleur.GetClients().Last().Prenom, "William"); Assert.AreEqual(controleur.GetClients().Last().Mail, "*****@*****.**"); }
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 TestCreateClientOk() { Controleur ctrl = new CommandeControleur(); ctrl.CreerClient("Wilson", "Wade", "*****@*****.**"); Assert.AreEqual("Wilson", ctrl.GetClients().Last().Nom); Assert.AreEqual("Wade", ctrl.GetClients().Last().Prenom); Assert.AreEqual("*****@*****.**", ctrl.GetClients().Last().Mail); }
public void TestCreerClient() { Controleur controleur = new CommandeControleur(); controleur.CreerClient("Minhoto", "Theo", "*****@*****.**"); Assert.AreEqual("Minhoto", controleur.GetClients().Last().Nom); Assert.AreEqual("Theo", controleur.GetClients().Last().Prenom); Assert.AreEqual("*****@*****.**", controleur.GetClients().Last().Mail); }
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 }
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); }
public void CreerClientOK() { Controleur controller = new CommandeControleur(); ClientDao client = new ClientDao(); int un = client.Clients.Count(); controller.CreerClient("DINDELEUX", "César", "*****@*****.**"); Assert.AreEqual(controller.GetClients().Last().Id, un + 1); // Vérifier que l'ID est bien augmenté de 1. Assert.AreEqual(controller.GetClients().Last().Nom, "DINDELEUX"); // Vérifier que le nom est bien inséré et correct Assert.AreEqual(controller.GetClients().Last().Prenom, "César"); // Vérifier que le prénom est bien inséré et correct Assert.AreEqual(controller.GetClients().Last().Mail, "*****@*****.**"); // Vérifier que le mail est bien inséré et correct Assert.AreEqual(controller.GetClients().Last().Commandes.Count(), 0); // Vérifier qu'à la création, ses commandes soient bien vides. }
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 }
public void TestAjoutClientOk() { Controleur c = new CommandeControleur(); ClientDao client = new ClientDao(); int unclient = client.Clients.Count(); c.AjouterClient("Gaborit", "Joan", "*****@*****.**"); Assert.AreEqual(c.GetClients().Last().Id, unclient + 1); Assert.AreEqual(c.GetClients().Last().Nom, "Gaborit"); Assert.AreEqual(c.GetClients().Last().Prenom, "Joan"); Assert.AreEqual(c.GetClients().Last().Mail, "*****@*****.**"); //J'ajoute un client avec un nom, un prénom et une adresse mail et je vérifie si le dernier client ajouté est bien égal aux informations //concernant l'ajout du client }
public void TestCommande() { CommandeControleur ctrl = new CommandeControleur(); Commande co = new Commande(); co.Client = "Tony"; co.LignesCommande = 3; ctrl.CreerCommande(co.Client, co.LignesCommande); Assert.AreEqual("Tony", ctrl.GetCommandes().Last().Client); }
public void TestAjoutClient() { CommandeControleur ctrl = new CommandeControleur(); Client c = new Client(); c.Nom = "Tourman"; c.Prenom = "Benjamin"; c.Mail = "*****@*****.**"; c.Commandes = new List <Commande>(); ctrl.CreerClient(c.Nom, c.Prenom, c.Mail, c.Commandes); Assert.AreEqual("Benjamin", ctrl.GetClients().Last().Prenom); }
public void TestAjoutClient() { CommandeControleur ctrl = new CommandeControleur(); //initilisation d'un client Client c = new Client(); c.Nom = "Tourman"; c.Prenom = "Benjamin"; c.Mail = "*****@*****.**"; ctrl.CreerClient(c); Assert.AreEqual("Benjamin", ctrl.GetClients().Last().Prenom); }
public void CreerCommande() { Controleur controleur = new CommandeControleur(); List <LigneCommande> Produits = new List <LigneCommande>(); Produits.Add(new LigneCommande() { Produit = controleur.GetProduits().Last(), Quantite = 5 }); Produits.Add(new LigneCommande() { Produit = controleur.GetProduits().First(), Quantite = 10 }); controleur.CreerCommande(controleur.GetClients().Last(), Produits); Assert.AreEqual(controleur.GetCommandes().Last().Client, controleur.GetClients().Last()); Assert.AreEqual(controleur.GetCommandes().Last().LignesCommande, Produits); }
public void TestAddCommande() { Controleur controleur = new CommandeControleur(); Client j = new Client(); j.Id = 666; j.Nom = "Castor"; j.Prenom = "Janounours"; j.Mail = "*****@*****.**"; List <LigneCommande> lgCmd = new List <LigneCommande>(); Commande c = new Commande(); c.Client = j; c.LignesCommande = lgCmd; c.Id = 666; controleur.CreerCommande(j, lgCmd); Assert.AreEqual(j, controleur.GetCommandes().Last().Client); Assert.AreEqual(lgCmd, controleur.GetCommandes().Last().LignesCommande); }
public void TestAjoutCommandeOk() { Controleur c2 = new CommandeControleur(); Client client = c2.GetClients().Last(); ICollection <LigneCommande> lignesCommande = new Collection <LigneCommande>(); LigneCommande ligneCmd = new LigneCommande() { Produit = c2.GetProduits().First(), Quantite = 2 }; lignesCommande.Add(ligneCmd); c2.CreerCommande(client, lignesCommande); Assert.AreEqual(c2.GetCommandes().Last().Client, client); Assert.AreEqual(c2.GetProduits().First().Id, 1); Assert.AreEqual(c2.GetCommandes().Last().LignesCommande.Last().Quantite, 2); //J'ajoute une commande qui contient un le dernier client de la liste, le premier produit de la liste et une quantité à 2 //Je vérifie qu'il me retourne bien que le dernier client de la liste commande bien 2 fois le premier produit de la liste }
public void AjoutCommandeOK() { Controleur control = new CommandeControleur(); Client Clt = new Client(); Clt.Nom = "Moriceau"; Clt.Prenom = "Alexis"; Clt.Mail = "*****@*****.**"; List <LigneCommande> lsc = new List <LigneCommande>(); lsc.Add(new LigneCommande() { Produit = control.GetProduits().First(), Quantite = 500 }); control.CreerCommande(Clt, lsc); Assert.AreEqual(Clt, control.GetCommandes().Last().Client); Assert.AreEqual(lsc, control.GetCommandes().Last().LignesCommande); }
public void TestClientNoCommande() { Controleur controleur = new CommandeControleur(); Client Test = new Client(); Test.Nom = "Minhoto"; Test.Prenom = "Theo"; Test.Mail = "*****@*****.**"; List <LigneCommande> Listecommand = new List <LigneCommande>(); Listecommand.Add(new LigneCommande() { Produit = controleur.GetProduits().First(), Quantite = 2 }); List <LigneCommande> ListCommandVide = new List <LigneCommande>(); Assert.AreEqual(Test, controleur.GetCommandes().Last().Client); Assert.AreNotEqual(ListCommandVide, controleur.GetCommandes().Last().LignesCommande); }
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); }
public void CreerCommandeOK() { Controleur controller = new CommandeControleur(); Client c1 = controller.GetClients().Last(); Produit produit = controller.GetProduits().Last(); LigneCommande ligneCMD = new LigneCommande() { Produit = controller.GetProduits().Last(), Quantite = 17 }; ICollection <LigneCommande> CommandeComplete = new Collection <LigneCommande>(); CommandeComplete.Add(ligneCMD); //AJOUTER LE TEST DE LA COMMANDE. controller.CreerCommande(c1, CommandeComplete); Assert.AreEqual(controller.GetCommandes().Last().Client, c1); // Vérifier que la commande prend bien en compte un client Assert.AreEqual(controller.GetCommandes().Last().LignesCommande, CommandeComplete); // Vérifier que la commande prend bien en compte la collection de ligne de cmd. }