예제 #1
0
        static void CompilerTest1()
        {
            // arrange
            string SourceFiles =
                @"..\..\..\ProgramTestInput\ExerciseCommits\add.h"
                + " "
                + @"..\..\..\ProgramTestInput\ExerciseCommits\mul.c";

            CompilerCaller cc = new CompilerCaller(ConfigFilePath);

            string[] errors;
            cc.Compile("mul", SourceFiles, out errors);

            // act
            string[] Output =
                ExternExeRunner.Run(@"..\..\..\ProgramTestOutput\mul.exe", null, null);

            // assert
            foreach (string op in Output)
            {
                System.Console.WriteLine(op);
            }

            System.Console.ReadKey();
        }
        public void Test1()
        {
            // arrange
            // REPLACE THIS ADDRESS TO THE ACTUAL ADDRESS ON YOUR PC!
            string adder = @"C:\Users\HASEE\source\repos\ExeternExeRunner\ExeternExeRunner\Adder.exe";

            string[] args =
            {
                "2",        // 2 groups of test data
                "1 2",
                "3 4"
            };
            string[] RefResults =
            {
                "3",
                "7"
            };

            // act
            string[] results = ExternExeRunner.Run(adder, args);

            // assert
            for (int i = 0; i < results.Length; i++)
            {
                Assert.AreEqual(RefResults[i], results[i]);
            }
        }