private void VerifyTestNameDuplicated(UniqueConfigurationJsonNotation test) { if (!string.IsNullOrEmpty(test.name) && _requestNames.Contains(test.name)) { throw new Exception($"config duplicated names '{test.name}'"); } _requestNames.Add(test.name); }
public static UniqueConfiguration ConvertUniqueConfiguration(UniqueConfigurationJsonNotation uniqueConfigurationJSONNotation) { Enum.TryParse <Method>(uniqueConfigurationJSONNotation.method, ignoreCase: true, out var method); return(new UniqueConfiguration( uniqueConfigurationJSONNotation.name, uniqueConfigurationJSONNotation.url, method, _readerHeader.Read(uniqueConfigurationJSONNotation.header?.ToString() ?? string.Empty), _readerCookies.Read(uniqueConfigurationJSONNotation.cookies?.ToString() ?? string.Empty), _readerQueryString.Read(uniqueConfigurationJSONNotation.query_string?.ToString() ?? string.Empty), _readerBody.Read(uniqueConfigurationJSONNotation.body?.ToString()?.Trim() ?? string.Empty), uniqueConfigurationJSONNotation.body?.ToString()?.Trim() ?? string.Empty, JSONToValidation(uniqueConfigurationJSONNotation.validation), uniqueConfigurationJSONNotation.Wait )); }