Beispiel #1
0
        public void Element_ChangeOfElementPropertiesAfterAddingToCommandTree_ThrowsException()
        {
            RootCommand cmd = MPOptions.GetRoot();
            Option opt = new Option("mike", "t1", false);
            Argument arg=new Argument("arg");

            cmd.Add(opt).Add(arg);

            AssertHelper.Throws<InvalidOperationException>(() => opt.WithStaticValidator("foo","bar"));
            AssertHelper.Throws<InvalidOperationException>(() => arg.WithNoValidator());
        }