コード例 #1
0
        public void Return_A_Null_sha_When_Ref_Result_Is_Not_Found()
        {
            Inquisitor.Arrange(i => i.GetRefForRepo(Arg.AnyString, Arg.AnyString)).Returns(NotfoundRefResult);

            var firstRepo = Target.GetReposForUser("erikdietrich").First();

            Assert.IsNull(firstRepo.Sha);
        }
コード例 #2
0
        public void Return_No_Repositories_For_NotFound_UserId()
        {
            Inquisitor.Arrange(i => i.GetRepoSearchResults(Arg.AnyString)).Returns(NotFoundResult);

            var repos = Target.GetReposForUser("doesntmatter");

            Assert.IsFalse(repos.Any());
        }
コード例 #3
0
        public void Should_Return_Empty_FilesList_When_Tree_Result_Is_Not_Found()
        {
            Inquisitor.Arrange(i => i.GetRecursiveTree(Arg.AnyString, Arg.AnyString, Arg.AnyString)).Returns(NotFoundTreeResult);

            var firstRepo = Target.GetReposForUser("erikdietrich").First();

            Assert.AreEqual <int>(0, firstRepo.Files.Count());
        }
コード例 #4
0
        public void BeforeEachTest()
        {
            Inquisitor = Mock.Create <IGithubInquisitor>();
            Inquisitor.Arrange(i => i.GetRepoSearchResults(Arg.AnyString)).Returns(SingleResult);
            Inquisitor.Arrange(i => i.GetRefForRepo(Arg.AnyString, Arg.AnyString)).Returns(RefResult);
            Inquisitor.Arrange(i => i.GetRecursiveTree(Arg.AnyString, Arg.AnyString, Arg.AnyString)).Returns(ChessTddRecursiveTreeResult);

            Target = new ProfileSearcher(Inquisitor);
        }