public static void Validate(Action <string[], string, string[]> setKeys) { if (setKeys == null) { throw new ArgumentNullException(SortHelpers.GetParameterName(new { setKeys }), "A setKeys function must be defined."); } }
public static void Validate(string delimiter) { if (string.IsNullOrEmpty(delimiter)) { throw new ArgumentNullException(SortHelpers.GetParameterName(new { delimiter }), "The delimiter can not be null or empty."); } }
private static void ArgumentValidation(Action <MergePurgeParam> processData) { if (processData == null) { throw new ArgumentNullException(SortHelpers.GetParameterName(new { processData }), "The processData action method must be defined."); } }
private static void ArgumentValidation <T>(DelimitedFileSource <T> delimitedFileSource) { if (string.IsNullOrWhiteSpace(delimitedFileSource.Delimiter)) { throw new ArgumentNullException(SortHelpers.GetParameterName(new { delimitedFileSource.Delimiter }), "The delimiter can not be null or empty."); } }
public static void Validate(string sourcefilePath, Action <string, string[]> setKeys, string destinationFolder) { if (setKeys == null) { throw new ArgumentNullException(SortHelpers.GetParameterName(new { setKeys }), "A setKeys function must be defined."); } Validate(sourcefilePath, destinationFolder); }
public static void Validate <T>(string sourcefilePath, Func <string, T> getKey, string destinationFolder, int maxBatchSize) { if (getKey == null) { throw new ArgumentNullException(SortHelpers.GetParameterName(new { getKey }), "A GetKey function must be defined."); } Validate(sourcefilePath, destinationFolder); Validate(maxBatchSize); }
public static void Validate(int maxBatchSize) { if (maxBatchSize <= 0) { throw new ArgumentNullException(SortHelpers.GetParameterName(new { maxBatchSize }), "The maxBatchSize must be greater than zero."); } else if (maxBatchSize > int.MaxValue) { throw new ArgumentNullException(SortHelpers.GetParameterName(new { maxBatchSize }), "The maxBatchSize can not be greater than integer maximum value."); } }
private static void ArgumentValidation(IFileSource fileSource) { if (string.IsNullOrWhiteSpace(fileSource.SourceFilePath)) { throw new ArgumentNullException(SortHelpers.GetParameterName(new { fileSource }), "The sourceFilePath cannot be null or empty."); } if (!File.Exists(fileSource.SourceFilePath)) { throw new FileNotFoundException(string.Format("The sourceFilePath , {0} , does not exist.", fileSource.SourceFilePath)); } }
private static void ArgumentValidation <T>(FixedWidthFileSource <T> fixedWidthFileSource) { if (fixedWidthFileSource.FixedWidths == null) { throw new ArgumentNullException(SortHelpers.GetParameterName(new { fixedWidthFileSource.FixedWidths }), "The file source fixed widths can not be null."); } if (fixedWidthFileSource.FixedWidths.Length == 0) { throw new ArgumentException("The file source fixed widths cannot be empty.", SortHelpers.GetParameterName(new { fixedWidthFileSource.FixedWidths })); } }
public static void Validate(string sourcefilePath, string destinationFolder) { if (string.IsNullOrWhiteSpace(sourcefilePath)) { throw new ArgumentNullException(SortHelpers.GetParameterName(new { sourcefilePath }), "The sourceFilePath cannot be null or empty."); } if (!File.Exists(sourcefilePath)) { throw new FileNotFoundException("The sourceFilePath , " + sourcefilePath + " , does not exist."); } if (destinationFolder != null && !Directory.Exists(destinationFolder)) { throw new DirectoryNotFoundException("The destination folder, " + destinationFolder + " , does not exist."); } }