Example #1
0
        public void ValidationCallHandlerIgnoresAttributeValidationIfSpecificationSourceIsConfig()
        {
            IUnityContainer factory = new UnityContainer().AddNewExtension <Interception>();

            factory.Configure <Interception>().SetDefaultInterceptorFor <ValidationFixtureTarget>(new TransparentProxyInterceptor());
            AddValidationPolicy(factory, string.Empty, SpecificationSource.Configuration, new TypeMatchingRule("ValidationFixtureTarget"));
            ValidationFixtureTarget target = factory.Resolve <ValidationFixtureTarget>();

            target.AcceptTest(new TestObject(true, false));
        }
Example #2
0
        public void ValidationCallHandlerThrowsArgumentValidationExceptionIfValidationFailsFromConfiguration()
        {
            IUnityContainer factory = new UnityContainer().AddNewExtension <Interception>();

            factory.Configure <Interception>().SetDefaultInterceptorFor <ValidationFixtureTarget>(new TransparentProxyInterceptor());
            AddValidationPolicy(factory, string.Empty, SpecificationSource.Configuration, new TypeMatchingRule("ValidationFixtureTarget"));
            ValidationFixtureTarget target = factory.Resolve <ValidationFixtureTarget>();

            target.AcceptTest(new TestObject(false, true));
        }