public void HelpParameterParserTests_args_have_sourcefile_but_no_help_Expect_IsPresent_False()
        {
            _mockEnvironment
            .Setup(expression: m => m.GetCommandLineArgs())
            .Returns(value: new[] { "mytext.txt" });

            HelpParameter actual = _systemUnderTest.ParseHelpParameter();

            Assert.NotNull(@object: actual);
            Assert.False(condition: actual.IsPresent);
        }
        public void HelpParameterParserTests_args_have_h_Expect_IsPresent_True()
        {
            _mockEnvironment
            .Setup(expression: m => m.GetCommandLineArgs())
            .Returns(value: new[] { "-h" });

            HelpParameter actual = _systemUnderTest.ParseHelpParameter();

            Assert.NotNull(@object: actual);
            Assert.True(condition: actual.IsPresent);
        }
        public void HelpParameterParserTests_args_is_empty_Expect_IsPresent_False()
        {
            _mockEnvironment
            .Setup(expression: m => m.GetCommandLineArgs())
            .Returns(value: new string[0]);

            HelpParameter actual = _systemUnderTest.ParseHelpParameter();

            Assert.NotNull(@object: actual);
            Assert.False(condition: actual.IsPresent);
        }
Exemplo n.º 4
0
        public bool ShowHelpIfRequested()
        {
            HelpParameter helpParameter = HelpParameterParser.ParseHelpParameter();

            bool isPresent = helpParameter.IsPresent;

            if (isPresent)
            {
                DisplayOutput.WriteLine(text: $"{Assembly.Name} - {Assembly.Version}");
                DisplayOutput.WriteLine(text: string.Empty);
                DisplayOutput.WriteLine(text: "-h | -help : Display this help");
                DisplayOutput.WriteLine(text: "-index : Display the index of the analyzed Text");
                DisplayOutput.WriteLine(text: "-dictionary=file : Uses the dictionary with the given file");
                DisplayOutput.WriteLine(text: "-stopwordlist=file : Uses the stopword with the given file. Default: stopword.txt");
                DisplayOutput.WriteLine(text: "-texturl=url : Takes the text file from an url");
                DisplayOutput.WriteLine(text: "-lang=language : Supported languages: de, en. Default: en");
            }

            return(helpParameter.IsPresent);
        }