示例#1
0
        public static void AssertPositiveNumber(int?optionalNumber, string source)
        {
            BaseValidator.CheckNullAndThrow(optionalNumber, source);
            int number = optionalNumber.Value;

            if (number <= 0)
            {
                throw new ArgumentException(source + " : " + "Positive number expected");
            }
        }
示例#2
0
        public static void ValidateItemId(string itemId, string source)
        {
#warning @igk clarify the item id pattern
            BaseValidator.CheckForNullEmptyAndWhiteSpaceOrThrow(itemId, source);

            bool correctIdLenght = (itemId.Length == 36 || itemId.Length == 38);
            if (!correctIdLenght)
            {
                throw new ArgumentException(source + " : " + INVALID_ID_MESSAGE);
            }
        }