public void Test_That_Validator_Is_Working() { //.NET compiler tries to prevent the following scenario: IValidator <object> someObjectValidator = new MyValidator(); someObjectValidator.Validate(new YourObject()); // Can't use MyValidator to validate Yourobject someObjectValidator = new YoursValdator(); someObjectValidator.Validate(new MyObject()); // Can't use YoursValidator to validate MyObject }
public void Validate_StringShouldFail(string x) { //Arrange //Act MyValidator myValidator = new MyValidator(null); var actual = myValidator.Validate(x); //Assert Assert.False(actual.IsValid); }