Ejemplo n.º 1
0
        public void Should_Return_Error_Whern_InitParse_By_StringSchema()
        {
            string      argsText   = "-l -p 8080 -d /usr/logs";
            string      schemaText = "l:bool p:int d:string";
            ArgsParser  argsArray  = ArgsTests.InitArgsParam(argsText, schemaText, out ArgsSchema argsSchema);
            SchemaInfo  info       = argsSchema.GetSchemaInfo("d");
            ObjectParse parse      = new IntParse(info, argsArray, "p");

            Assert.Throws <ArgumentException>(() => parse.GetValue(), "缺省值设置默认类型不是int类型");
        }
Ejemplo n.º 2
0
 public void TestCleanUp()
 {
     obj = null;
 }
Ejemplo n.º 3
0
 public void TestInitialize()
 {
     obj = new IntParse();
 }