public void ArgumentRequiresOtherArgumentsCertification_shouldPass_whenMainArgumentNotPresent() { ArgumentRequiresOtherArgumentsCertification d = new ArgumentRequiresOtherArgumentsCertification("j", "l,m"); var commandLineParser = InitGroupCertifications(); commandLineParser.Certifications.Clear(); commandLineParser.Certifications.Add(d); string[] args = new[] { "-m" }; commandLineParser.ParseCommandLine(args); Assert.Equal(true, commandLineParser.ParsingSucceeded); }
// [Fact] TODO (Stef) This test is disabled for now because no MandatoryArgumentNotSetException is thrown and I don't know if this is correct or not. public void ArgumentRequiresOtherArgumentsCertification_shouldFail_whenRequiredArgumentsNotPresent() { ArgumentRequiresOtherArgumentsCertification d = new ArgumentRequiresOtherArgumentsCertification("j", "l,m"); var commandLineParser = InitGroupCertifications(); commandLineParser.Certifications.Clear(); commandLineParser.Certifications.Add(d); string[] args = new[] { "-j", "-l" }; var ex = Assert.Throws <MandatoryArgumentNotSetException>(() => commandLineParser.ParseCommandLine(args)); Assert.StartsWith("None of these", ex.Message); }