public UpdatedPullRequestHandler(
     PullRequestMatcher pullRequestMatcher,
     ITfsService tfsService,
     string projectName,
     string buildDefinitionName)
 {
     _pullRequestMatcher  = pullRequestMatcher;
     _tfsService          = tfsService;
     _projectName         = projectName;
     _buildDefinitionName = buildDefinitionName;
 }
        public UpdatedPullRequestHandlerTests()
        {
            _tfsService = Substitute.For <ITfsService>();
            _matcher    = new PullRequestMatcher("repo-.+", "master", "completed");

            _sut = new UpdatedPullRequestHandler(
                _matcher,
                _tfsService,
                ProjectName,
                BuildDefinitionName);
        }
Esempio n. 3
0
        public void WhenAtLeastOneParameterDoesntMatch_ThenThePullRequestIsNotAMatch(
            string repositoryNamePattern,
            string targetBranchName,
            string status)
        {
            var sut = new PullRequestMatcher(
                repositoryNamePattern,
                targetBranchName,
                status);

            sut.IsMatch(_pullRequest).Should().BeFalse();
        }
Esempio n. 4
0
        public void WhenAllParametersMatch_ThenThePullRequestIsAMatch(
            string repositoryNamePattern,
            string targetBranchName,
            string status)
        {
            var sut = new PullRequestMatcher(
                repositoryNamePattern,
                targetBranchName,
                status);

            sut.IsMatch(_pullRequest).Should().BeTrue();
        }