Example #1
0
        public void Validate()
        {
            List<Description> descs = DescriptionFactory.Create(CliOptions.WindowsStyle, new MockHelpProvider(),
                "/width:int");
            Validator v = new Validator(new OutputMessages(CliOptions.WindowsStyle, new MockOutput()));

            Assert.IsTrue(v.Validate(descs,
                RequestFactory.Create(CliOptions.WindowsStyle, new[] {"/width:10"}, descs, new MockOutputFactory())));
            Assert.IsFalse(v.Validate(descs,
                RequestFactory.Create(CliOptions.WindowsStyle, new string[0], descs, new MockOutputFactory())));
            Assert.IsFalse(v.Validate(descs,
                RequestFactory.Create(CliOptions.WindowsStyle, new[] {"/width:10", "/width:10"}, descs,
                    new MockOutputFactory())));
            Assert.IsFalse(v.Validate(descs,
                RequestFactory.Create(CliOptions.WindowsStyle, new[] {"10"}, descs, new MockOutputFactory())));
        }
Example #2
0
        public void Validator_1()
        {
            Validator v = new Validator(null);

            List<Description> descs = DescriptionFactory.Create(CliOptions.WindowsStyle, new MockHelpProvider(),
                "/width:int");
            Request request = RequestFactory.Create(CliOptions.WindowsStyle, new string[0], descs,
                new MockOutputFactory());

            Assert.IsTrue(v.Validate(descs, request));
        }
Example #3
0
 public void Validator_0()
 {
     Validator v = new Validator(new OutputMessages(CliOptions.WindowsStyle, new MockOutput()));
 }