Beispiel #1
0
 public void PropertyNameIsTrimmed()
 {
     var banana = new Product();
     banana.SetProperty("  My property     ", "test");
     Assert.AreEqual("test", banana.GetProperty(" My property "));
     Assert.AreEqual(banana.GetProperty("     My property  "), banana.GetProperty("My property"));
 }
Beispiel #2
0
 public void PropertyNameCannotStartWithHash()
 {
     var banana = new Product();
     Assert.Throws<Exception>(() => banana.SetProperty("#don't do it", "never"));
 }
Beispiel #3
0
 public void CanSetArbitratyProperty()
 {
     var banana = new Product();
     banana.SetProperty("The place where it grows", "Africa");
     Assert.AreEqual("Africa", banana.GetProperty("The place where it grows"));
 }