示例#1
0
        public void GetGitRepositoryInfoPassEmptyStringAndThrowsArgumentNullException()
        {
            this.client.Setup(x => x.GetAsync <IEnumerable <GitRepository> >(It.IsAny <string>())).Returns(Task.FromResult(FakeGitRepository.gitRepositoryList.AsEnumerable()));

            this.gitHubRepoService = new GitHubRepoService(client.Object);
            Assert.That(() => this.gitHubRepoService.GetGitRepositoryInfo(string.Empty), Throws.TypeOf <ArgumentNullException>());
        }
示例#2
0
 public void SetUp()
 {
     _mockConverter = new Mock <IJsonConverter>();
     _mockConfig    = new Mock <IConfig>();
     _mockWebClient = new Mock <IHttpWebClient>();
     _iService      = new GitHubRepoService(_mockConfig.Object, _mockWebClient.Object, _mockConverter.Object);
 }
示例#3
0
        public MarkdownContentUpdaterScheduledTask(IGitHubRepoService gitHubRepoService, IContentManager contentManager, IClock clock, IScheduledTaskManager scheduledTaskManager)
        {
            _gitHubRepoService    = gitHubRepoService;
            _contentManager       = contentManager;
            _clock                = clock;
            _scheduledTaskManager = scheduledTaskManager;

            Logger = NullLogger.Instance;
        }
示例#4
0
        public async Task GetGitRepositoryInfoReturnTypeGitRepository()
        {
            this.client.Setup(x => x.GetAsync <IEnumerable <GitRepository> >(It.IsAny <string>())).Returns(Task.FromResult(FakeGitRepository.gitRepositoryList.AsEnumerable()));

            this.gitHubRepoService = new GitHubRepoService(client.Object);

            var result = await this.gitHubRepoService.GetGitRepositoryInfo(repoUrl);

            Assert.IsInstanceOf(typeof(GitRepository), result.First());
        }
 public HomeController(IGitHubRepoService service)
 {
     this.gitHubservice = service;
     defaultUserRepository = Bootstrapper.GetDefaultGitHubRepo();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GitHubController"/> class.
 /// </summary>
 /// <param name="iRepoService">The i repo service.</param>
 /// <param name="iCommitService">The i commit service.</param>
 public GitHubController(IGitHubRepoService iRepoService, IGitHubCommitService iCommitService)
 {
     _iRepoService   = iRepoService;
     _iCommitService = iCommitService;
 }
 public GitHubRepoController(IGitHubRepoService gitHubRepoService)
 {
     _gitHubRepoService = gitHubRepoService;
 }
示例#8
0
 public GithubController(IGitHubRepoService gitHubRepoService,
                         GitHubViewModel gitHubViewModel)
 {
     this.gitHubRepoService = gitHubRepoService;
     this.gitHubViewModel   = gitHubViewModel;
 }
示例#9
0
 public void InstantiatingGitHubRepoServiceWithNullIWebApiClientThrowsNullRefException()
 {
     this.gitHubRepoService = new GitHubRepoService(null);
     Assert.That(() => this.gitHubRepoService.GetGitRepositoryInfo(repoUrl), Throws.TypeOf <NullReferenceException>());
 }
示例#10
0
 public GitHubUserViewModelService(IGitHubUserInfoService gitHubUserInfoService, IGitHubRepoService gitHubRepoService, IGitHubUserViewModelFactory gitHubUserViewModelFactory)
 {
     this.gitHubUserInfoService      = gitHubUserInfoService;
     this.gitHubRepoService          = gitHubRepoService;
     this.gitHubUserViewModelFactory = gitHubUserViewModelFactory;
 }