Ejemplo n.º 1
0
        [Trait(Traits.Style, Traits.Regression)] // Legacy Tests, replace when working on them.
        public void IntegerParameter_TooLarge_ReturnsCorrectError()
        {
            var clas = new CommandArgumentSupport();

            clas.ArgumentPostfix        = ":";
            clas.ArgumentPrefix         = "";
            clas.ArgumentPrefixOptional = true;

            var argsClass = new SampleCommandLine_C2();

            string[] args = new string[] {
                "filename:this is the filename",
                "INTVALUE:2200000000",
            };
            clas.ProcessArguments(argsClass, args);

            string[] erroredArguments = clas.ListArgumentsWithErrors();

            Assert.True(erroredArguments.Length > 0, "there was an errored argument");
            Assert.True(erroredArguments[0].Contains("INTVALUE"), "The correct argument was not found");
            Assert.True(erroredArguments[0].Contains("too large"), "The incorrect reason was found");
        }