Ejemplo n.º 1
0
        public void ValiderProduitRenseigne()
        {
            var lignePanier = new LignePanier
            {
                Produit  = null,
                Quantite = 1
            };
            var exception = Assert.ThrowsException <Exception>(() => lignePanier.Valider());

            Assert.AreEqual("Produit est requis", exception.Message);
        }
Ejemplo n.º 2
0
        public void ValiderQuantitePositive()
        {
            var lignePanier = new LignePanier
            {
                Produit  = new Produit(),
                Quantite = -1
            };
            var exception = Assert.ThrowsException <Exception>(() => lignePanier.Valider());

            Assert.AreEqual("Quantite doit être positive", exception.Message); // pensez a bien mette "exception.Message
        }