Beispiel #1
0
        public void Rule_Script_Contains_Run_Which_Is_Not_A_Function()
        {
            var snippet = new Snippet();
            var ruleCode = new StringBuilder();
            ruleCode.AppendLine("run = 100");

            var rule = new PyRule() { Code = ruleCode.ToString(), Weight = 1 };
            rule.Rank(snippet);
        }
Beispiel #2
0
        public void Running_Rule_With_Incorrect_Syntax_Throws_An_Exception()
        {
            var snippet = new Snippet();
            var ruleCode = new StringBuilder();
            ruleCode.AppendLine("de run(snippet):");
            ruleCode.AppendLine("  return 100;");

            var rule = new PyRule() { Code = ruleCode.ToString(), Weight = 1 };
            rule.Rank(snippet);
        }
Beispiel #3
0
        public void Rule_Script_Returns_A_Value_Of_Incompatible_Type()
        {
            var snippet = new Snippet();
            var ruleCode = new StringBuilder();
            ruleCode.AppendLine("def run(snippet):");
            ruleCode.AppendLine("  pass");

            var rule = new PyRule() { Code = ruleCode.ToString(), Weight = 1 };
            rule.Rank(snippet);
        }
Beispiel #4
0
        public void Rule_Script_Does_Not_Contain_Run_Function()
        {
            var snippet = new Snippet();
            var ruleCode = new StringBuilder();
            ruleCode.AppendLine("def notrun(snippet):");
            ruleCode.AppendLine("  return 100;");

            var rule = new PyRule() { Code = ruleCode.ToString(), Weight = 1 };
            rule.Rank(snippet);
        }