public void TestBuildMethod() { string[] args = new[] { "-path", @"D:/sample", "-date", "2020/01/01", "-doubleValue", "10.0", "-intValue", "1", "-floatValue", "100.0", "-enumValue", "Sample", }; SampleArg arg = Arg.Build <SampleArg>(args); Assert.AreEqual(@"D:/sample", arg.Path); Assert.AreEqual(new DateTime(2020, 1, 1), arg.Date); Assert.AreEqual(10.0, arg.DoubleValue); Assert.AreEqual(1, arg.IntValue); Assert.AreEqual(100.0, arg.FloatValue); Assert.AreEqual(ESampleEnum.Sample, arg.EnumValue); }