Exemplo n.º 1
0
        public void ShouldReturnCalculateCorrectPRDescriptionWhenUpdatingExistingPR()
        {
            PullRequestDescriptionBuilder pullRequestDescriptionBuilder = new PullRequestDescriptionBuilder(new NullLoggerFactory(), "");
            UpdateAssetsParameters        update1 = CreateUpdateAssetsParameters(false, "11111111-1111-1111-1111-111111111111");
            UpdateAssetsParameters        update2 = CreateUpdateAssetsParameters(false, "22222222-2222-2222-2222-222222222222");
            UpdateAssetsParameters        update3 = CreateUpdateAssetsParameters(false, "33333333-3333-3333-3333-333333333333");
            List <DependencyUpdate>       deps1   = CreateDependencyUpdates('a');
            List <DependencyUpdate>       deps2   = CreateDependencyUpdates('b');
            List <DependencyUpdate>       deps3   = CreateDependencyUpdates('c');
            Build build = GivenANewBuild(true);

            pullRequestDescriptionBuilder.AppendBuildDescription(update1, deps1, null, build);
            pullRequestDescriptionBuilder.AppendBuildDescription(update2, deps2, null, build);
            pullRequestDescriptionBuilder.AppendBuildDescription(update3, deps3, null, build);

            String description = pullRequestDescriptionBuilder.ToString();

            description.Should().Contain(BuildCorrectPRDescriptionWhenCoherencyUpdate(deps1, 1));
            description.Should().Contain(BuildCorrectPRDescriptionWhenCoherencyUpdate(deps2, 3));
            description.Should().Contain(BuildCorrectPRDescriptionWhenCoherencyUpdate(deps3, 5));

            List <DependencyUpdate> deps22 = CreateDependencyUpdates('d');

            pullRequestDescriptionBuilder.AppendBuildDescription(update2, deps22, null, build);

            description = pullRequestDescriptionBuilder.ToString();

            description.Should().Contain(BuildCorrectPRDescriptionWhenCoherencyUpdate(deps1, 1));
            description.Should().Contain(BuildCorrectPRDescriptionWhenCoherencyUpdate(deps3, 5));
            description.Should().NotContain(BuildCorrectPRDescriptionWhenCoherencyUpdate(deps2, 3));
            description.Should().Contain(BuildCorrectPRDescriptionWhenCoherencyUpdate(deps22, 7));
        }
Exemplo n.º 2
0
        public void ShouldReturnCalculateCorrectPRDescriptionWhenNonCoherencyUpdate()
        {
            PullRequestDescriptionBuilder pullRequestDescriptionBuilder = new PullRequestDescriptionBuilder(new NullLoggerFactory(), "");
            UpdateAssetsParameters        update = CreateUpdateAssetsParameters(true, "11111111-1111-1111-1111-111111111111");
            List <DependencyUpdate>       deps   = CreateDependencyUpdates('a');

            pullRequestDescriptionBuilder.AppendBuildDescription(update, deps, null, null);

            pullRequestDescriptionBuilder.ToString().Should().Contain(BuildCorrectPRDescriptionWhenNonCoherencyUpdate(deps));
        }