public void CannotCreateTShirtsWithNegativePrice() { Assert.Catch(() => { var x = new TShirts ("H&M", "Schwarz", "Medium", -32); }); }
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); }
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; }); }