private static void BuildFeatureCompareResultExistInOneFolderOnly(IEnumerable<string> notExistInOtherDir,
            List<DirectoryInfo> featureFolderList,
            CompareResult compareResult,
            bool isFirstFolder)
        {
            foreach (var feature in notExistInOtherDir)
            {
                var folder = featureFolderList.First(x => x.Name == feature);
                var featureCompareResult = new FeatureFolderCompareResult();
                featureCompareResult.FeatureFolderName = folder.Name;
                featureCompareResult.FeatureFolderFullName = folder.FullName;
                featureCompareResult.Status = isFirstFolder
                    ? FolderCompareStatus.FirstFolderOnly
                    : FolderCompareStatus.SecondFolderOnly;

                var files = folder.GetFiles("*.json").ToList();
                foreach (var fileInfo in files)
                {
                    var fileCompareResult = new DataFileCompareResult();
                    fileCompareResult.FileName = fileInfo.Name;
                    fileCompareResult.FullName = fileInfo.FullName;
                    fileCompareResult.Status = isFirstFolder
                        ? FileCompareStatus.FirstFolderOnly
                        : FileCompareStatus.SecondFolderOnly;

                    featureCompareResult.ListDataFileCompareResult.Add(fileCompareResult);
                }

                compareResult.ListFeatureFolderCompareResult.Add(featureCompareResult);
            }
        }
        private static void BuildFileCompareResultExistInOneFolderOnly(IEnumerable<string> fileNotExistInOtherFolder,
            FileInfo[] fileInFolder
            , FeatureFolderCompareResult featureCompareResult,
            bool isFirstFolder)
        {
            foreach (var fileName in fileNotExistInOtherFolder)
            {
                var fileInfo = fileInFolder.First(x => x.Name == fileName);
                var fileCompareResult = new DataFileCompareResult();
                fileCompareResult.FileName = fileName;
                fileCompareResult.FullName = fileInfo.FullName;
                fileCompareResult.Status = isFirstFolder
                    ? FileCompareStatus.FirstFolderOnly
                    : FileCompareStatus.SecondFolderOnly;

                featureCompareResult.ListDataFileCompareResult.Add(fileCompareResult);
            }
        }
        private static void CompareFileContent(FileInfo[] filesInFirstFolder, string fileName, FileInfo[] filesInSecondFolder,
            FeatureFolderCompareResult featureCompareResult)
        {
            //compare file content with just read content as string and compare string
            var file1 = filesInFirstFolder.First(x => x.Name == fileName);
            var file2 = filesInSecondFolder.First(x => x.Name == fileName);

            var fileContent1 = File.ReadAllText(file1.FullName);
            var fileContent2 = File.ReadAllText(file2.FullName);

            // Compare the JSON versions of the file
            var json1 = JsonConvert.DeserializeObject(fileContent1) as JToken;
            var json2 = JsonConvert.DeserializeObject(fileContent2) as JToken;

            // To compare strings, use:
            // if (String.CompareOrdinal(fileContent1, fileContent2) != 0)

            if (!JToken.DeepEquals(json1, json2))
            {
                //content is different
                var fileCompareResult = new DataFileCompareResult();
                fileCompareResult.FileName = fileName;
                fileCompareResult.Status = FileCompareStatus.DifferentContent;

                featureCompareResult.ListDataFileCompareResult.Add(fileCompareResult);
            }
        }