public void TestNullWithEmptyString()
 {
     IValueExtractor ive = MockUtils.CreateExtractor(repository, null);
     var rv = new RequiredValidator(ive, "");
     Assert.IsFalse(rv.Validate(null), "Requried Validator does not check for null when has a default value");
     repository.VerifyAll();
 }
 public void TestNullValueInteger()
 {
     IValueExtractor ive = MockUtils.CreateExtractor(repository, 1);
     var rv = new RequiredValidator(ive, 1);
     Assert.IsFalse(rv.Validate(null), "Requried Validator does not recognize default value to be null");
     repository.VerifyAll();
 }
 public void TestNullValue()
 {
     IValueExtractor ive = MockUtils.CreateExtractor(repository, null);
     var rv = new RequiredValidator(ive, null);
     Assert.IsFalse(rv.Validate(null), "Requried Validator does not check null");
     repository.VerifyAll();
 }
 public void TestNotNullValue()
 {
     IValueExtractor ive = MockUtils.CreateExtractor(repository, new object());
     var rv = new RequiredValidator(ive, null);
     Assert.IsTrue(rv.Validate(null), "Requried Validator does not check object difference from null");
     repository.VerifyAll();
 }
 public void TestValueExtractorCorrectlyCalled()
 {
     var newObject = new object();
     IValueExtractor ive = MockUtils.CreateExtractor(repository, null, newObject);
     var rv = new RequiredValidator(ive, null);
     Assert.IsFalse(rv.Validate(newObject), "Requried Validator does not check null");
     repository.VerifyAll();
 }
 public void TestWithEmptyString()
 {
     IValueExtractor ive = MockUtils.CreateExtractor(repository, "");
     var rv = new RequiredValidator(ive, "");
     Assert.IsFalse(rv.Validate(null), "Requried Validator does not recognize \"\" as null");
     repository.VerifyAll();
 }