@@ -1530,6 +1530,46 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
15301530
15311531 #endregion
15321532
1533+ #region OptionInlineNamespacesEvaluationRule
1534+
1535+ evaluator = new ExpressionEvaluator ( )
1536+ {
1537+ OptionInlineNamespacesEvaluationRule = InlineNamespacesEvaluationRule . BlockAll
1538+ } ;
1539+
1540+ yield return new TestCaseData ( evaluator , "new System.Collections.Generic.List<string>(){\" -\" }" , typeof ( ExpressionEvaluatorSyntaxErrorException ) )
1541+ . SetCategory ( "Options" )
1542+ . SetCategory ( "InlineNamespacesEvaluationRule.BlockAll" )
1543+ . SetCategory ( "OptionInlineNamespacesEvaluationRule" ) ;
1544+
1545+ evaluator = new ExpressionEvaluator ( )
1546+ {
1547+ OptionInlineNamespacesEvaluationRule = InlineNamespacesEvaluationRule . AllowOnlyInlineNamespacesList
1548+ } ;
1549+
1550+ evaluator . InlineNamespacesList = evaluator . Namespaces . ToList ( ) ;
1551+
1552+ evaluator . InlineNamespacesList . Remove ( "System.Collections.Generic" ) ;
1553+
1554+ yield return new TestCaseData ( evaluator , "new System.Collections.Generic.List<string>()" , typeof ( ExpressionEvaluatorSyntaxErrorException ) )
1555+ . SetCategory ( "Options" )
1556+ . SetCategory ( "InlineNamespacesEvaluationRule.AllowOnlyInlineNamespacesList" )
1557+ . SetCategory ( "OptionInlineNamespacesEvaluationRule" ) ;
1558+
1559+ evaluator = new ExpressionEvaluator ( )
1560+ {
1561+ OptionInlineNamespacesEvaluationRule = InlineNamespacesEvaluationRule . BlockOnlyInlineNamespacesList
1562+ } ;
1563+
1564+ evaluator . InlineNamespacesList = evaluator . Namespaces . ToList ( ) ;
1565+
1566+ yield return new TestCaseData ( evaluator , "new System.Collections.Generic.List<string>(){ \" \" }" , typeof ( ExpressionEvaluatorSyntaxErrorException ) )
1567+ . SetCategory ( "Options" )
1568+ . SetCategory ( "InlineNamespacesEvaluationRule.BlockOnlyInlineNamespacesList" )
1569+ . SetCategory ( "OptionInlineNamespacesEvaluationRule" ) ;
1570+
1571+ #endregion
1572+
15331573 #endregion
15341574
15351575 #region TypesToBlock
0 commit comments