Exemple #1
0
    public void Should_Return_Formatted_Milestone_With_Multiple_Issues()
    {
        // Given
        var milestone = new Milestone
        {
            Description    = "Imprement xxx feature.",
            DueDate        = new DateTime(2019, 1, 15),
            RepositoryName = "test",
            UserName       = "******",
            Title          = "v1.0.0",
            Issues         = new[]
            {
                new Issue {
                    AssignedUserName = "******"
                },
                new Issue {
                    AssignedUserName = "******"
                },
                new Issue {
                    AssignedUserName = "******"
                },
                new Issue {
                    AssignedUserName = "******"
                },
            }
        };

        // When
        var formatted = milestone.Format();

        // Then
        Assert.Equal("* [root/test], [v1.0.0], [2019/01/15], [Imprement xxx feature.], [user1, user2, user3]", formatted);
    }
Exemple #2
0
    public void Should_Return_Formatted_Milestone_With_No_Issue()
    {
        // Given
        var milestone = new Milestone
        {
            Description    = "Imprement xxx feature.",
            DueDate        = new DateTime(2019, 1, 15),
            RepositoryName = "test",
            UserName       = "******",
            Title          = "v1.0.0",
            Issues         = Array.Empty <Issue>()
        };

        // When
        var formatted = milestone.Format();

        // Then
        Assert.Equal("* [root/test], [v1.0.0], [2019/01/15], [Imprement xxx feature.], []", formatted);
    }
Exemple #3
0
    public void Should_Return_Formatted_Milestone_With_New_Line()
    {
        // Given
        var milestone = new Milestone
        {
            Description    = $"Imprement xxx feature.{Environment.NewLine}Next",
            DueDate        = new DateTime(2019, 1, 15),
            RepositoryName = "test",
            UserName       = "******",
            Title          = "v1.0.0",
            Issues         = new[] { new Issue {
                                         AssignedUserName = "******"
                                     }, }
        };

        // When
        var formatted = milestone.Format();

        // Then
        Assert.Equal("* [root/test], [v1.0.0], [2019/01/15], [Imprement xxx feature. Next], [user1]", formatted);
    }
Exemple #4
0
    public void Should_Return_Formatted_Milestone_With_Long_Description()
    {
        // Given
        var milestone = new Milestone
        {
            Description    = "Long-Long-Long-Long-Long-Long-Long-Long-Long-Long-Long-TItle",
            DueDate        = new DateTime(2019, 1, 15),
            RepositoryName = "test",
            UserName       = "******",
            Title          = "v1.0.0",
            Issues         = new[] { new Issue {
                                         AssignedUserName = "******"
                                     }, }
        };

        // When
        var formatted = milestone.Format();

        // Then
        Assert.Equal("* [root/test], [v1.0.0], [2019/01/15], [Long-Long-Long-Long-Long-Long-...], [user1]", formatted);
    }
Exemple #5
0
    public void Should_Return_Formatted_Milestone_With_No_DueDate()
    {
        // Given
        var milestone = new Milestone
        {
            Description    = "Imprement xxx feature.",
            DueDate        = null,
            RepositoryName = "test",
            UserName       = "******",
            Title          = "v1.0.0",
            Issues         = new[] { new Issue {
                                         AssignedUserName = "******"
                                     }, }
        };

        // When
        var formatted = milestone.Format();

        // Then
        Assert.Equal("* [root/test], [v1.0.0], [], [Imprement xxx feature.], [user1]", formatted);
    }