Exemple #1
0
        public void Issue12()
        {
            // Issue #12: PrincipalPermissionAttribute causes InvalidCastException when applied to service methods
            // http://code.google.com/p/jayrock/issues/detail?id=12

            SecuredService service = new SecuredService();
            Method         method  = service.GetClass().GetMethodByName("SecuredMethod");

            try
            {
                method.Invoke(service, null, null);
            }
            catch (TargetMethodException e)
            {
                Assert.IsNotNull(e.InnerException);
                throw e.InnerException;
            }
        }
Exemple #2
0
        public void Issue12()
        {
            // Issue #12: PrincipalPermissionAttribute causes InvalidCastException when applied to service methods 
            // http://code.google.com/p/jayrock/issues/detail?id=12

            SecuredService service = new SecuredService();
            Method method = service.GetClass().GetMethodByName("SecuredMethod");
            try
            {
                method.Invoke(service, null, null);
            }
            catch (TargetMethodException e)
            {
                Assert.IsNotNull(e.InnerException);
                throw e.InnerException;
            }
        }