Exemple #1
0
        private static void CheckRunCompareFolder(string[] p_Args, string p_ExpectedFolderPath, string p_ActualFolderPath, string p_Message = "")
        {
            int returnValue = CliApp.Run(p_Args);

            Assert.AreEqual(0, returnValue, p_Message + ": wrong return value");
            AssertFoldersEqual(p_ExpectedFolderPath, p_ActualFolderPath, p_Message + ": folders differ");
        }
Exemple #2
0
        private static void CheckRunFileExists(string[] p_Args, string p_UnexpectedOutput, string p_Message)
        {
            int returnValue = CliApp.Run(p_Args);

            Assert.AreEqual(0, returnValue, p_Message + ": wrong return value");
            Assert.IsTrue(!File.Exists(p_UnexpectedOutput), p_Message + ": file exists but should not");
        }
Exemple #3
0
        // Comapators
        private static void CheckRunCompareFile(string[] p_Args, string p_ExpectedFilePath, string p_ActualFilePath, string p_Message = "", int p_ReturnCode = 0)
        {
            int returnValue = CliApp.Run(p_Args);

            Assert.AreEqual(p_ReturnCode, returnValue, p_Message + ": wrong return value");
            AssertFilesEqual(p_ExpectedFilePath, p_ActualFilePath, p_Message + ": files differ");
        }
Exemple #4
0
        static void Main(string[] args)
        {
            Cli = new CliAppBuilder()
                  .AddActionArg(FindPackage, "Find NuGet package using API", "find")
                  .Build();

            Cli.Start(args);
        }
        }        // -----------------------------------------

        /// <summary>
        /// Sets and Checks a new FFMPEG PATH
        /// </summary>
        /// <param name="ffmpeg_path">Folder FFMPEG is in,</param>
        public static void setFFMPEGPath(string ffmpeg_path = "")
        {
            if (CliApp.exists(Path.Combine(ffmpeg_path, FFMPEG_EXE)))
            {
                FFMPEG_OK   = true;
                FFMPEG_PATH = ffmpeg_path;
            }
        }        // -----------------------------------------
Exemple #6
0
        // todo: remove this method?
        private static void CheckRunFail(string[] p_Args, int p_ExpectedReturnValue, string p_Message = "")
        {
            int returnValue = CliApp.Run(p_Args);

            Assert.AreEqual(p_ExpectedReturnValue, returnValue, p_Message + ": wrong return value");

            // todo make check for console output?
            // todo check files not modified?
        }
Exemple #7
0
        private static void CheckRunCompareOutput(string[] p_Args, string p_ExpectedOutput, string p_Message = "")
        {
            StringWriter stringWriter = new();

            Console.SetOut(stringWriter);

            int returnValue = CliApp.Run(p_Args);

            Assert.AreEqual(0, returnValue, p_Message + ": wrong return value");

            string ActualOutput = stringWriter.ToString();

            Assert.AreEqual("\r\n" + p_ExpectedOutput, "\r\n" + ActualOutput, p_Message + ": outputs are not equal");
        }
Exemple #8
0
        public static int Main(string[] p_Args)
        {
            if (p_Args != null && p_Args.Length > 0)
            {
                return(CliApp.Run(p_Args));
            }
            else
            {
                HideConsoleWindow();
                GuiApp guiApp = new();
                guiApp.InitializeComponent();
                guiApp.Run();

                return(0);
            }
        }
Exemple #9
0
 static void Main(string[] args)
 {
     CliApp.Run <Program>();
 }