예제 #1
0
        public void TestFindMethodName()
        {
            string actionExpression   = "HasRightInInstitute(#user, 'parameterwert')";
            string expectedMethodName = "HasRightInInstitute";

            string methodeName = PreAuthorizeAttribute.ParseMethodeName(actionExpression);

            Assert.AreEqual(expectedMethodName, methodeName);
        }
예제 #2
0
        public void TestParseMethodNameWithoutParams()
        {
            string actionExpression = "hasRight";

            Assert.Throws <InvalidOperationException>(() => PreAuthorizeAttribute.ParseMethodeName(actionExpression));
        }
예제 #3
0
        public void TestToShortMethodName()
        {
            string actionExpression = "a(#uhuhuhuhuh, #sdsdsd)";

            Assert.Throws <InvalidOperationException>(() => PreAuthorizeAttribute.ParseMethodeName(actionExpression));
        }