Example #1
0
        public void CanInterceptClassWithReservedTypeAttributes()
        {
            InterceptingClassGenerator generator =
                new InterceptingClassGenerator(typeof(HtmlInputText));

            Type generatedType = generator.GenerateType();

            HtmlInputText instance = (HtmlInputText)Activator.CreateInstance(generatedType);

            bool intercepted = false;

            ((IInterceptingProxy)instance)
            .AddInterceptionBehavior(
                new ActionInterceptionBehavior(() => intercepted = true));

            var result = instance.HasControls();

            Assert.IsTrue(intercepted);
        }