示例#1
0
 public void TestSetValidationHandler()
 {
     _sample      = AggregateRootSample.CreateSample();
     _sample.Name = "abcd";
     _sample.AddValidationRule(new ValidationRuleSample(_sample));
     _sample.SetValidationHandler(new ValidationHandlerSample());
     _sample.Validate();
 }
示例#2
0
 public void TestAddValidationRule()
 {
     _sample = AggregateRootSample.CreateSample();
     AssertHelper.Throws <Warning>(() => {
         _sample.Name = "abcd";
         _sample.AddValidationRule(new ValidationRuleSample(_sample));
         _sample.Validate();
     }, "名称长度不能大于3");
 }