public void NullInstance() { ParameterCheckerTestValue param = null; Result <ParameterCheckerResultCode> result = ParameterChecker.HasInvalidProperty(param); Assert.IsTrue(result.ResultCode == ParameterCheckerResultCode.NullArgError); }
[DataRow(0, 0, "", "12", ParameterCheckerResultCode.LengthError)] // arg4最小文字数 - 1 public void InvalidParam(Nullable <int> arg1, Nullable <int> arg2, string arg3, string arg4, ParameterCheckerResultCode expected) { ParameterCheckerTestValue param = new ParameterCheckerTestValue() { reqParam = arg1, notReqParam = arg2, max10LenReqParam = arg3, max10Min3LenParam = arg4 }; Result <ParameterCheckerResultCode> result = ParameterChecker.HasInvalidProperty(param); Assert.IsTrue(result.ResultCode == expected); }