Пример #1
0
        public async Task GetRepositoryList_WrongPath_ThrowArgumentException()
        {
            var fileRepos = new FilesStrategy(string.Empty);

            await Assert.ThrowsAsync <InvalidOperationException>(async()
                                                                 => await fileRepos.GetRepositoriesList()
                                                                 );
        }
Пример #2
0
        public async Task GetRepositoriesList_ReadThreeDir_ReturnThreeDir()
        {
            var reposPath = Settings.Instanse.PathToTestData + Settings.ReposDirFolder;

            var fileRepos = new FilesStrategy(reposPath);

            var result = await fileRepos.GetRepositoriesList();

            Assert.Equal(3, result.Length);
        }
Пример #3
0
        private static async Task <ProjectSourceCodes> SourceWithOneDependency()
        {
            var reposPath = Settings.Instanse.PathToTestData + Settings.OneDepndencyInRepository;
            IProjectsRepository fileRepos         = new FilesStrategy(reposPath);
            RepositoryContext   repositoryContext = new RepositoryContext(fileRepos);


            var collection = await repositoryContext.GetAsync();

            var sourceSodes = collection.Take();

            return(sourceSodes);
        }
Пример #4
0
        public async Task GetSourcesAsync_SetOneDependencyInRepository_ReturnProperProjectName()
        {
            var reposPath = Settings.Instanse.PathToTestData + Settings.OneDepndencyInRepository;

            var             fileRepos = new FilesStrategy(reposPath);
            IRepositoryData data      = new FileSystemRepository
            {
                Name = reposPath,
                Path = reposPath
            };
            var result = await fileRepos.GetSourcesAsync(data);

            Assert.Equal("ServiceName", result.ProjectName);
        }
Пример #5
0
        public async Task GetSourcesAsync_SetOneDependencyInRepository_ReturnOneDependencyFile()
        {
            var reposPath = Settings.Instanse.PathToTestData + Settings.OneDepndencyInRepository;

            var             fileRepos = new FilesStrategy(reposPath);
            IRepositoryData data      = new FileSystemRepository
            {
                Name = reposPath,
                Path = reposPath
            };
            var result = await fileRepos.GetSourcesAsync(data);

            Assert.Single(result.Files);
        }