@@ -15,11 +15,23 @@ namespace Egil.RazorComponents.Testing.Asserting
1515 /// </summary>
1616 public static class ShouldBeTextChangeAssertExtensions
1717 {
18+ /// <summary>
19+ /// Verifies that a list of diffs contains only a single change, and that change is a change to a text node.
20+ /// </summary>
21+ /// <param name="diffs">The list of diffs to verify against.</param>
22+ /// <param name="expectedChange">The expected text change.</param>
23+ /// <param name="userMessage">A custom error message to show if the verification fails.</param>
1824 public static void ShouldHaveSingleTextChange ( this IReadOnlyList < IDiff > diffs , string expectedChange , string ? userMessage = null )
1925 {
2026 DiffAssertExtensions . ShouldHaveSingleChange ( diffs ) . ShouldBeTextChange ( expectedChange , userMessage ) ;
2127 }
2228
29+ /// <summary>
30+ /// Verifies that a diff is a change to a text node.
31+ /// </summary>
32+ /// <param name="actualChange">The diff to verify.</param>
33+ /// <param name="expectedChange">The expected text change.</param>
34+ /// <param name="userMessage">A custom error message to show if the verification fails.</param>
2335 public static void ShouldBeTextChange ( this IDiff actualChange , string expectedChange , string ? userMessage = null )
2436 {
2537 if ( actualChange is null ) throw new ArgumentNullException ( nameof ( actualChange ) ) ;
@@ -32,12 +44,24 @@ public static void ShouldBeTextChange(this IDiff actualChange, string expectedCh
3244 ShouldBeTextChange ( actualChange , expected , userMessage ) ;
3345 }
3446
47+ /// <summary>
48+ /// Verifies that a diff is a change to a text node.
49+ /// </summary>
50+ /// <param name="actualChange">The diff to verify.</param>
51+ /// <param name="expectedChange">The rendered fragment containing the expected text change.</param>
52+ /// <param name="userMessage">A custom error message to show if the verification fails.</param>
3553 public static void ShouldBeTextChange ( this IDiff actualChange , IRenderedFragment expectedChange , string ? userMessage = null )
3654 {
3755 if ( expectedChange is null ) throw new ArgumentNullException ( nameof ( expectedChange ) ) ;
3856 ShouldBeTextChange ( actualChange , expectedChange . GetNodes ( ) , userMessage ) ;
3957 }
4058
59+ /// <summary>
60+ /// Verifies that a diff is a change to a text node.
61+ /// </summary>
62+ /// <param name="actualChange">The diff to verify.</param>
63+ /// <param name="expectedChange">The node list containing the expected text change.</param>
64+ /// <param name="userMessage">A custom error message to show if the verification fails.</param>
4165 public static void ShouldBeTextChange ( this IDiff actualChange , INodeList expectedChange , string ? userMessage = null )
4266 {
4367 if ( actualChange is null ) throw new ArgumentNullException ( nameof ( actualChange ) ) ;
0 commit comments