public async Task GetRepositoryList_WrongPath_ThrowArgumentException() { var fileRepos = new FilesStrategy(string.Empty); await Assert.ThrowsAsync <InvalidOperationException>(async() => await fileRepos.GetRepositoriesList() ); }
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); }
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); }
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); }
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); }