예제 #1
0
        public void Read_Procedure_Verify_IsLocal(int index, bool expected)
        {
            var result = ALParser.ReadSingle(testPath);
            var actual = result.Methods.ElementAt(index).IsLocal == expected;

            Assert.IsTrue(actual);
        }
예제 #2
0
        [TestCase(1, true)]  // Does not have Return Type
        public void Read_Procedure_Verify_ReturnType(int index, bool expected)
        {
            var result = ALParser.ReadSingle(testPath);
            var actual = string.IsNullOrEmpty(result.Methods.ElementAt(index).ReturnTypeDefinition.Name.Trim()) == expected;

            Assert.IsTrue(actual);
        }
예제 #3
0
        static void Main(string[] args)
        {
            var path     = args != null && args.Count() > 0 ? args[0] : @".\test_cu.al";
            var codeunit = ALParser.ReadSingle(path);

            Console.WriteLine($"Object info: {codeunit.Type} {codeunit.Id} {codeunit.Name}");
            Console.WriteLine($"Object path: {path}");
            Console.WriteLine("-----------------------------------------------------------");
            foreach (var method in codeunit.Methods)
            {
                Console.WriteLine($"Method: {method.Name} including {method.Parameters.Count()} pparameter(s)");
                Console.WriteLine();
                foreach (var param in method.Parameters)
                {
                    Console.WriteLine($"  Parameter: #{param.Name} {param.TypeDefinition?.Name}");
                }
                Console.WriteLine("-----------------------------------------------------------");
            }

            Console.ReadLine();
        }
예제 #4
0
        public void Read_Procedure_Verify_TestAttribute()
        {
            var result = ALParser.ReadSingle(testPath);

            Assert.IsTrue(result.Methods.First().TestMethod);
        }
예제 #5
0
        public void Read_Procedure_Verify_Parameters()
        {
            var result = ALParser.ReadSingle(testPath);

            Assert.IsTrue(result.Methods.First().Parameters.Count > 0);
        }