public async Task <IEnumerable <CodeFragment> > ProcessAddedFiles(ICollection <string> addedFiles)
        {
            if (!addedFiles.Any())
            {
                return(Enumerable.Empty <CodeFragment>());
            }

            var codeFiles = new List <CodeFile>();

            foreach (var filePath in addedFiles)
            {
                var codeFile = await _githubService.GetCodeFileAsync(filePath);

                await _codeFileRepository.StoreAsync(codeFile);

                codeFiles.Add(codeFile);
            }

            return(codeFiles.SelectMany(file => file.CodeFragments));
        }
        public async Task ProcessAddedFiles_MoreAddedFiles_ReturnAllCodeFragments()
        {
            var codeFragment1 = new CodeFragment
            {
                Identifier = "test_identifier",
                Content    = "test content",
                Language   = CodeFragmentLanguage.CSharp,
                Platform   = CodeFragmentPlatform.Net,
            };

            var codeFragment2 = new CodeFragment
            {
                Identifier = "test_identifier",
                Content    = "test content",
                Language   = CodeFragmentLanguage.TypeScript,
                Platform   = CodeFragmentPlatform.TypeScript,
            };

            var fragmentsList = new List <CodeFragment> {
                codeFragment1, codeFragment2
            };

            var codeFile = new CodeFile
            {
                FilePath      = TestPath,
                CodeFragments = fragmentsList
            };

            _githubService
            .GetCodeFileAsync(TestPath)
            .Returns(codeFile);

            var result = await _fileProcessor.ProcessAddedFiles(new Collection <string> {
                TestPath
            });

            CollectionAssert.AreEquivalent(fragmentsList, result);
        }