Esempio n. 1
0
        public void GivenSimpleArguments_FindReleases_RetrievesTagsAndReleases()
        {
            const string repoOwner = "foo";
            const string repoName  = "bar";
            var          repoMock  = new Mock <IRepositoriesClient>();

            clientMock.Setup(client => client.Repository).Returns(repoMock.Object).Verifiable();
            var releasesMock = new Mock <IReleasesClient>();

            repoMock.SetupGet(repo => repo.Release).Returns(releasesMock.Object).Verifiable();
            releasesMock.Setup(releases => releases.GetAll(repoOwner, repoName))
            .Returns(Task.FromResult <IReadOnlyList <Release> >(new List <Release>()))
            .Verifiable();

            var argBuilder = new ArgumentsBuilder();

            argBuilder.AddMatcher(".*");
            argBuilder.SetOwner(repoOwner);
            argBuilder.SetProject(repoName);

            var results = cut.FindReleases(argBuilder.Build(), new ConstantValueFilter(true));

            Mock.VerifyAll(clientMock, repoMock, releasesMock);
            Assert.AreEqual(0, results.Count);
        }
        public static ArgumentsBuilder BaseBuilder()
        {
            var builder = new ArgumentsBuilder();

            builder.AddMatcher(".*");
            builder.SetOwner(Owner);
            builder.SetProject(Project);
            return(builder);
        }