Exemple #1
0
        public async Task ShouldNotFilterWhenSearchFails()
        {
            var collaborationFactory = Substitute.For <ICollaborationFactory>();

            collaborationFactory.CollaborationPlatform.Search(null).ThrowsForAnyArgs(new Exception());

            IRepositoryFilter subject = new RepositoryFilter(collaborationFactory, Substitute.For <INuKeeperLogger>());

            var result = await subject.ContainsDotNetProjects(MakeSampleRepository());

            Assert.True(result);
        }
Exemple #2
0
        public async Task ShouldNotFilterWhenSearchFails()
        {
            var githubClient = Substitute.For <IGitHub>();

            githubClient.Search(null).ThrowsForAnyArgs(new Exception());

            IRepositoryFilter subject = new RepositoryFilter(githubClient, Substitute.For <INuKeeperLogger>());

            var result = await subject.ContainsDotNetProjects(MakeSampleRepository());

            Assert.True(result);
        }
Exemple #3
0
        public async Task ShouldNotFilterWhenMatchFound()
        {
            var collaborationFactory = Substitute.For <ICollaborationFactory>();

            collaborationFactory.CollaborationPlatform.Search(null).ReturnsForAnyArgs(Task.FromResult(new SearchCodeResult(1)));

            IRepositoryFilter subject = new RepositoryFilter(collaborationFactory, Substitute.For <INuKeeperLogger>());

            var result = await subject.ContainsDotNetProjects(MakeSampleRepository());

            Assert.True(result);
        }
Exemple #4
0
        public async Task ShouldNotFilterWhenMatchFound()
        {
            var githubClient = Substitute.For <IGitHub>();

            githubClient.Search(null).ReturnsForAnyArgs(Task.FromResult(new SearchCodeResult(1, false, null)));

            IRepositoryFilter subject = new RepositoryFilter(githubClient, Substitute.For <INuKeeperLogger>());

            var result = await subject.ContainsDotNetProjects(MakeSampleRepository());

            Assert.True(result);
        }