public void Found() { DefaultValidationDispatcher dispatcher = new DefaultValidationDispatcher(); dispatcher.AddSearchHandler(TryGetValidationHandler); Assert.AreEqual(true, dispatcher.Validate("Hello, World!").IsValid); Assert.AreEqual(false, dispatcher.Validate("Xyz").IsValid); }
public void Valid() { DefaultValidationDispatcher dispatcher = new DefaultValidationDispatcher(true); IValidationResult result = dispatcher.Validate("Hello, World!"); Assert.AreEqual(true, result.IsValid); }
public void NotFound() { DefaultValidationDispatcher dispatcher = new DefaultValidationDispatcher(); dispatcher.AddSearchHandler(TryGetValidationHandler); dispatcher.Validate(55); }
public void Exception() { DefaultValidationDispatcher dispatcher = new DefaultValidationDispatcher(); dispatcher.Validate("Hello, World!"); }