Exemplo n.º 1
0
        static bool CheckFiles(FileNames files)
        {
            var headList = files.Select(x => GetFileName(x).Split('_').First()).Distinct().ToList();

            foreach (var head in headList)
            {
                var test     = GetFileName(files.First()).Split('_').Last();
                var namelist = files.Where(x => head == GetFileName(x).Split('_').First()).ToList();

                // case : only single files exist
                if (namelist.Count < 2)
                {
                    return(false);
                }

                var thcks = ThckFilter(namelist);
                var rflts = RfltFilter(namelist);

                // case : only single rflt and result exist.
                // prevent 1-1_1_Result.csv and  1-1_2_Result.csv
                if (thcks.Count() != 1 || rflts.Count() != 1)
                {
                    return(false);
                }
            }
            return(true);
        }