Skip to content

Commit 9e35f78

Browse files
committed
docs: added CounterTest.razor
1 parent 552c9cb commit 9e35f78

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@inherits TestContext
2+
@code {
3+
[Fact]
4+
public void CounterShouldIncrementWhenClicked()
5+
{
6+
// Arrange: render the Counter.razor component
7+
var cut = Render(@<Counter />);
8+
9+
// Act: find and click the <button> element to increment
10+
// the counter in the <p> element
11+
cut.Find("button").Click();
12+
13+
// Assert: first find the <p> element, then verify its content
14+
cut.Find("p").MarkupMatches(@<p>Current count: 1</p>);
15+
}
16+
}

0 commit comments

Comments
 (0)