Skip to content

Commit 1fd5ba6

Browse files
authored
refactor: Made additional types internal
1 parent eb0a011 commit 1fd5ba6

File tree

7 files changed

+7
-58
lines changed

7 files changed

+7
-58
lines changed

src/bunit/Diffing/BlazorDiffingHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Bunit.Diffing;
77
/// <summary>
88
/// Blazor Diffing Helpers.
99
/// </summary>
10-
public static class BlazorDiffingHelpers
10+
internal static class BlazorDiffingHelpers
1111
{
1212
/// <summary>
1313
/// Represents a diffing filter that removes all special Blazor attributes added by the /<see cref="Htmlizer"/>.

src/bunit/Diffing/DiffMarkupFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Bunit.Diffing;
77
/// <summary>
88
/// A markup formatter, that skips any special Blazor attributes added by the <see cref="Htmlizer"/>.
99
/// </summary>
10-
public class DiffMarkupFormatter : PrettyMarkupFormatter, IMarkupFormatter
10+
internal class DiffMarkupFormatter : PrettyMarkupFormatter, IMarkupFormatter
1111
{
1212
/// <summary>
1313
/// Initializes a new instance of the <see cref="DiffMarkupFormatter"/> class.

src/bunit/Diffing/HtmlComparer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Bunit.Diffing;
1010
/// <summary>
1111
/// Represents a test HTML comparer, that is configured to work with markup generated by the <see cref="BunitRenderer"/> and <see cref="Htmlizer"/> classes.
1212
/// </summary>
13-
public sealed class HtmlComparer
13+
internal sealed class HtmlComparer
1414
{
1515
private readonly HtmlDiffer differenceEngine;
1616

src/bunit/Extensions/BlazorExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Bunit.Extensions;
33
/// <summary>
44
/// Extensions for Blazor types.
55
/// </summary>
6-
public static class BlazorExtensions
6+
internal static class BlazorExtensions
77
{
88
/// <summary>
99
/// Creates a <see cref="RenderFragment"/> that will render the <paramref name="markup"/>.

src/bunit/Extensions/BunitServiceProviderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Bunit.Extensions;
1212
/// <summary>
1313
/// Helper methods for correctly registering test dependencies.
1414
/// </summary>
15-
public static class BunitServiceProviderExtensions
15+
internal static class BunitServiceProviderExtensions
1616
{
1717
/// <summary>
1818
/// Registers the default services required by the web <see cref="BunitContext"/>.

src/bunit/Extensions/NodePrintExtensions.cs

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Bunit;
1010
/// <summary>
1111
/// Helper methods for pretty printing markup from <see cref="INode"/> and <see cref="INodeList"/>.
1212
/// </summary>
13-
public static class NodePrintExtensions
13+
internal static class NodePrintExtensions
1414
{
1515
/// <summary>
1616
/// Writes the serialization of the node guided by the formatter.
@@ -28,21 +28,6 @@ public static void ToHtml(this IEnumerable<INode> nodes, TextWriter writer, IMar
2828
}
2929
}
3030

31-
/// <summary>
32-
/// Uses the <see cref="DiffMarkupFormatter"/> to generate a HTML markup string
33-
/// from a <see cref="IEnumerable{INode}"/> <paramref name="nodes"/>.
34-
/// The generated HTML markup will NOT include the internal Blazor attributes
35-
/// added to elements.
36-
/// </summary>
37-
public static string ToDiffMarkup(this IEnumerable<INode> nodes)
38-
{
39-
ArgumentNullException.ThrowIfNull(nodes);
40-
41-
using var sw = new StringWriter();
42-
nodes.ToHtml(sw, new DiffMarkupFormatter());
43-
return sw.ToString();
44-
}
45-
4631
/// <summary>
4732
/// Uses the <see cref="DiffMarkupFormatter"/> to generate a HTML markup string
4833
/// from a <see cref="IMarkupFormattable"/> <paramref name="markupFormattable"/>.
@@ -58,42 +43,6 @@ public static string ToDiffMarkup(this IMarkupFormattable markupFormattable)
5843
return sw.ToString();
5944
}
6045

61-
/// <summary>
62-
/// Uses the <see cref="PrettyMarkupFormatter"/> to generate a HTML markup string
63-
/// from a <see cref="IEnumerable{INode}"/> <paramref name="nodes"/>.
64-
/// </summary>
65-
public static string ToMarkup(this IEnumerable<INode> nodes)
66-
{
67-
ArgumentNullException.ThrowIfNull(nodes);
68-
69-
using var sw = new StringWriter();
70-
var formatter = new PrettyMarkupFormatter
71-
{
72-
NewLine = Environment.NewLine,
73-
Indentation = " ",
74-
};
75-
nodes.ToHtml(sw, formatter);
76-
return sw.ToString();
77-
}
78-
79-
/// <summary>
80-
/// Uses the <see cref="PrettyMarkupFormatter"/> to generate a HTML markup
81-
/// from a <see cref="IMarkupFormattable"/> <paramref name="markupFormattable"/>.
82-
/// </summary>
83-
public static string ToMarkup(this IMarkupFormattable markupFormattable)
84-
{
85-
ArgumentNullException.ThrowIfNull(markupFormattable);
86-
87-
using var sw = new StringWriter();
88-
var formatter = new PrettyMarkupFormatter
89-
{
90-
NewLine = Environment.NewLine,
91-
Indentation = " ",
92-
};
93-
markupFormattable.ToHtml(sw, formatter);
94-
return sw.ToString();
95-
}
96-
9746
/// <summary>
9847
/// Converts an <see cref="IElement"/> into a HTML markup string,
9948
/// with only its tag and attributes included in the output. All

src/bunit/Rendering/BunitHtmlParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Bunit.Rendering;
1212
/// A AngleSharp based HTML Parse that can parse markup strings
1313
/// into a <see cref="INodeList"/>.
1414
/// </summary>
15-
public sealed class BunitHtmlParser : IDisposable
15+
internal sealed class BunitHtmlParser : IDisposable
1616
{
1717
private const string TbodySubElements = "TR";
1818
private const string ColgroupSubElement = "COL";

0 commit comments

Comments
 (0)