protected void BuildSettings() { var isByName = !string.IsNullOrEmpty(keyNames) || !string.IsNullOrEmpty(valueNames) || columnsDef.Any(c => !string.IsNullOrEmpty(c.Name)); if (isMultipleRows && isByName) { var keyNamesList = new List <string>(); if (!string.IsNullOrEmpty(keyNames)) { var keys = keyNames.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries); keyNamesList.AddRange((keys.Select(x => x.Trim()).ToList())); } var valueNamesList = new List <string>(); if (!string.IsNullOrEmpty(valueNames)) { var values = valueNames.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries); valueNamesList.AddRange((values.Select(x => x.Trim()).ToList())); } var allColumns = keyNamesList.Select(x => new Column() { Name = x, Role = ColumnRole.Key, Type = ColumnType.Text }) .Union(valueNamesList.Select(x => new Column() { Name = x, Role = ColumnRole.Value, Type = valuesDefaultType }) .Union(columnsDef) ); settings = new SettingsResultSetComparisonByName(valuesDefaultType, defaultTolerance, allColumns); } else if (isMultipleRows && !isByName) { settings = new SettingsResultSetComparisonByIndex(keysDef, valuesDef, valuesDefaultType, defaultTolerance, columnsDef); } else if (!isMultipleRows) { settings = new SettingsSingleRowComparison(valuesDefaultType, defaultTolerance, columnsDef); } else { throw new InvalidOperationException(); } }
public void Setup(SettingsResultSetComparisonByName settings) { isBuild = false; this.settings = settings; isSetup = true; }
public BaseResultSetComparisonConstraint Using(ISettingsResultSetComparison settings) { this.Engine.Settings = settings; return(this); }