Пример #1
0
    public void TwoParameters()
    {
        var sb = new StructuredStringBuilder();

        using (var commentWrapper = new Comment(sb))
        {
            commentWrapper.AddParameter("name", "The name of the thing");
            commentWrapper.AddParameter("thing", "The thing of the thing");
        }

        var expected = new string[]
        {
            "/// <param name=\"name\">The name of the thing</param>",
            "/// <param name=\"thing\">The thing of the thing</param>",
        };

        Assert.Equal(expected, sb);
    }
Пример #2
0
    public void WriteOnDispose()
    {
        var sb = new StructuredStringBuilder();

        using (var commentWrapper = new Comment(sb))
        {
            commentWrapper.Return.AppendLine("Awesomeness,");
            var description = new StructuredStringBuilder();
            description.AppendLine("The name of");
            description.AppendLine("the thing");

            commentWrapper.Parameters["name"] = description;

            commentWrapper.Summary.AppendLine("An awesome summary.");
            commentWrapper.Return.AppendLine("sheer awesomeness!");

            commentWrapper.AddParameter("thing", "The thing of the thing");
        }

        var expected = new string[]
        {
            "/// <summary>",
            "/// An awesome summary.",
            "/// </summary>",
            "/// <param name=\"name\">",
            "/// The name of",
            "/// the thing",
            "/// </param>",
            "/// <param name=\"thing\">The thing of the thing</param>",
            "/// <returns>",
            "/// Awesomeness,",
            "/// sheer awesomeness!",
            "/// </returns>",
        };

        Assert.Equal(expected, sb);
    }