public void TestFindMethodName() { string actionExpression = "HasRightInInstitute(#user, 'parameterwert')"; string expectedMethodName = "HasRightInInstitute"; string methodeName = PreAuthorizeAttribute.ParseMethodeName(actionExpression); Assert.AreEqual(expectedMethodName, methodeName); }
public void TestParseMethodNameWithoutParams() { string actionExpression = "hasRight"; Assert.Throws <InvalidOperationException>(() => PreAuthorizeAttribute.ParseMethodeName(actionExpression)); }
public void TestToShortMethodName() { string actionExpression = "a(#uhuhuhuhuh, #sdsdsd)"; Assert.Throws <InvalidOperationException>(() => PreAuthorizeAttribute.ParseMethodeName(actionExpression)); }