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类型"); }
public void TestCleanUp() { obj = null; }
public void TestInitialize() { obj = new IntParse(); }