Ejemplo n.º 1
0
 public void Level2FirstTest3()
 {
     Level2.CoolBuilder builder = new Level2.CoolBuilder();
     try
     {
         Level2.IMyCoolInterface testImplementation = builder.build();
     }
     catch(Level2.MissingNameException ex)
     {
         Assert.IsTrue(ex.Message.Contains("Name should be specified"));
         return;
     }
     Assert.Fail("Exception should be thrown");
 }
Ejemplo n.º 2
0
 public void Level2FirstTest1()
 {
     String testName = "My Name";
     int quality = 22;
     Level2.CoolBuilder builder = new Level2.CoolBuilder();
     Level2.IMyCoolInterface testImplementation = builder.setName(testName).setQuality(quality).build();
     Assert.AreEqual(testName,testImplementation.getName());
     Assert.IsTrue(testImplementation.getDescription().Contains("Name: " + testName));
     Assert.IsTrue(testImplementation.getDescription().Contains("Quality: " + quality));
     testImplementation.increaseQuality();
     Assert.AreNotEqual(quality,testImplementation.getQuality());
 }
Ejemplo n.º 3
0
 public void Level2FirstTest2()
 {
     String testName = "some name";
     Level2.CoolBuilder builder = new Level2.CoolBuilder();
     Level2.IMyCoolInterface testImplementation = builder.setName(testName).build();
     Assert.AreEqual(testName, testImplementation.getName());
     Assert.IsTrue(testImplementation.getDescription().Contains("Name: Some Name"));
     Assert.IsTrue(testImplementation.getDescription().Contains("Quality: 0"));
     testImplementation.increaseQuality();
     Assert.AreNotEqual(0, testImplementation.getQuality());
 }