Exemple #1
0
 public void CannotCreateTShirtsWithNegativePrice()
 {
     Assert.Catch(() =>
         {
             var x = new TShirts ("H&M", "Schwarz", "Medium", -32);
         });
 }
Exemple #2
0
        public void CanCreateTShirts()
        {
            var x = new TShirts ("H&M", "Schwarz", "Medium", 19.99);

            Assert.IsTrue(x.Marke == "H&M");
            Assert.IsTrue(x.Farbe == "Schwarz");
            Assert.IsTrue (x.Groesse == "Medium");
            Assert.IsTrue(x.Preis == 19.99);
        }
Exemple #3
0
 public void UpdateTShirtsPreisWithNegative(double testvar)
 {
     Assert.Catch(() =>
         {
             testvar = -300;
             var xy = new TShirts ("H&M", "Schwarz", "Medium", 19.99);
             if (testvar < 0) throw new ArgumentOutOfRangeException ("Preis darf nicht kleiner 0 sein.");
             xy.Preis = testvar;
         });
 }