示例#1
0
文件: Tests.cs 项目: amanf/oom
 public void CannotCreateTShirtsWithNegativePrice()
 {
     Assert.Catch(() =>
         {
             var x = new TShirts ("H&M", "Schwarz", "Medium", -32);
         });
 }
示例#2
0
文件: Tests.cs 项目: amanf/oom
        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);
        }
示例#3
0
文件: Tests.cs 项目: amanf/oom
 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;
         });
 }