We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 552c9cb commit 9e35f78Copy full SHA for 9e35f78
1 file changed
docs/samples/tests/razor/CounterTest.razor
@@ -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