예제 #1
0
 public NuGetWrapper(NureOptions p_NureOptions,
                     string p_RepositoryDirectory)
 {
     m_NureOptions         = p_NureOptions;
     m_RepositoryDirectory = p_RepositoryDirectory;
     m_MonitoredProjects   = GetProjects();
 }
예제 #2
0
 public PullRequestWriterFactory(NureOptions p_NureOptions,
                                 string p_HostingUsername,
                                 string p_HostingPassword)
 {
     m_NureOptions     = p_NureOptions;
     m_HostingUsername = p_HostingUsername;
     m_HostingPassword = p_HostingPassword;
 }
예제 #3
0
        public void ValidPullRequestIsSent()
        {
            BitbucketPullRequest bitbucketPullRequest = new BitbucketPullRequest();
            List <BitbucketUser> reviewers            = GivenDefaultReviewers();
            NureOptions          nureOptions          = GivenNureOptions();

            m_ClientMock.Setup(client => client.GetCurrentUser()).Returns(new BitbucketUser());
            m_ClientMock.Setup(client => client.GetDefaultReviewers()).Returns(reviewers);
            m_ClientMock.Setup(client => client.SendPullRequest(It.IsAny <BitbucketPullRequest>())).Callback <BitbucketPullRequest>(pr => bitbucketPullRequest = pr);

            BitbucketPullRequestWriter pullRequestWriter = new BitbucketPullRequestWriter(nureOptions, m_ClientMock.Object);

            pullRequestWriter.WritePullRequest(A_BRANCH_NAME);

            m_ClientMock.Verify(client => client.GetCurrentUser());
            m_ClientMock.Verify(client => client.GetDefaultReviewers());
            m_ClientMock.Verify(client => client.SendPullRequest(It.IsAny <BitbucketPullRequest>()));

            Assert.Equal(nureOptions.PullRequestTitle, bitbucketPullRequest.Title);
            Assert.Equal(nureOptions.PullRequestDescription, bitbucketPullRequest.Description);
            Assert.Equal(A_BRANCH_NAME, bitbucketPullRequest.SourceBranch.Branch.Name);
            Assert.Equal(nureOptions.DefaultBranch, bitbucketPullRequest.DestinationBranch.Branch.Name);
            Assert.Equal(reviewers, bitbucketPullRequest.Reviewers);
        }
예제 #4
0
 public GitHubPullRequestWriter(NureOptions p_NureOptions,
                                string p_AccessToken)
 {
     m_NureOptions = p_NureOptions;
     m_AccessToken = p_AccessToken;
 }
예제 #5
0
 public NuKeeperWrapper(NureOptions p_NureOptions,
                        string p_RepositoryDirectory)
 {
     m_NureOptions         = p_NureOptions;
     m_RepositoryDirectory = p_RepositoryDirectory;
 }
예제 #6
0
 public BitbucketPullRequestWriter(NureOptions p_NureOptions,
                                   IBitbucketClient p_BitbucketClient)
 {
     m_NureOptions     = p_NureOptions;
     m_BitbucketClient = p_BitbucketClient;
 }