예제 #1
0
        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);
        }
예제 #3
0
        public void NotFound()
        {
            DefaultValidationDispatcher dispatcher = new DefaultValidationDispatcher();

            dispatcher.AddSearchHandler(TryGetValidationHandler);

            dispatcher.Validate(55);
        }
        public void Exception()
        {
            DefaultValidationDispatcher dispatcher = new DefaultValidationDispatcher();

            dispatcher.Validate("Hello, World!");
        }