예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void errorOnInvalidPid() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ErrorOnInvalidPid()
        {
            string[] args = new string[] { "--pid=a", "all" };
            using (RealOutsideWorld outsideWorld = new RealOutsideWorld())
            {
                DiagnosticsReportCommand diagnosticsReportCommand = new DiagnosticsReportCommand(_homeDir, _configDir, outsideWorld);
                CommandFailed            commandFailed            = assertThrows(typeof(CommandFailed), () => diagnosticsReportCommand.execute(args));
                assertEquals("Unable to parse --pid", commandFailed.Message);
            }
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void allHasToBeOnlyClassifier() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void AllHasToBeOnlyClassifier()
        {
            string[] args = new string[] { "all", "logs", "tx" };
            using (RealOutsideWorld outsideWorld = new RealOutsideWorld())
            {
                DiagnosticsReportCommand diagnosticsReportCommand = new DiagnosticsReportCommand(_homeDir, _configDir, outsideWorld);

                IncorrectUsage incorrectUsage = assertThrows(typeof(IncorrectUsage), () => diagnosticsReportCommand.execute(args));
                assertEquals("If you specify 'all' this has to be the only classifier. Found ['logs','tx'] as well.", incorrectUsage.Message);
            }
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void printUnrecognizedClassifiers() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void PrintUnrecognizedClassifiers()
        {
            string[] args = new string[] { "logs", "tx", "invalid" };
            using (RealOutsideWorld outsideWorld = new RealOutsideWorld())
            {
                DiagnosticsReportCommand diagnosticsReportCommand = new DiagnosticsReportCommand(_homeDir, _configDir, outsideWorld);

                IncorrectUsage incorrectUsage = assertThrows(typeof(IncorrectUsage), () => diagnosticsReportCommand.execute(args));
                assertEquals("Unknown classifier: invalid", incorrectUsage.Message);
            }
        }
예제 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void exitIfConfigFileIsMissing() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ExitIfConfigFileIsMissing()
        {
            Files.delete(_configFile);
            string[] args = new string[] { "--list" };
            using (RealOutsideWorld outsideWorld = new RealOutsideWorld())
            {
                DiagnosticsReportCommand diagnosticsReportCommand = new DiagnosticsReportCommand(_homeDir, _configDir, outsideWorld);

                CommandFailed commandFailed = assertThrows(typeof(CommandFailed), () => diagnosticsReportCommand.execute(args));
                assertThat(commandFailed.Message, containsString("Unable to find config file, tried: "));
            }
        }