/// <summary> /// Checks if a provided configuration file contains frequencies of processors /// </summary> /// <returns> /// An empty string if it is valid, /// an error message if invalid /// </returns> /// <param name="configFileContent">Content of a configuration file</param> public static string ContainsProcessorFrequencies(string configFileContent) { List <float> processorFrequencies = ConfigFileParser.GetProcessorFrequencies(configFileContent); List <string> processorIds = ConfigFileParser.GetProcessorIds(configFileContent); if (processorFrequencies.Count == 0 || processorIds.Count == 0 || processorFrequencies.Count != processorIds.Count) { return(ConfigErrors["ProcessorFrequencies"]); } else { // check if processor ids are unique if (processorIds.Distinct().Count() != processorIds.Count) { return(ConfigErrors["ProcessorFrequenciesIds"]); } return(""); } }