Skip to content

Commit f4aa7cf

Browse files
authored
Updated README
1 parent a1a7b79 commit f4aa7cf

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,15 @@ namespace MyApp.Tests.Controllers
209209
{
210210
[Fact]
211211
public void ReturnOkWithCorrectModelWhenCallingAuthenticatedIndexAction()
212-
=> MyMvc
213-
.Controller<HomeController>(instance => instance
214-
.WithUser("TestUser")
215-
.WithData(MyTestData.GetData()))
216-
.Calling(c => c.Index())
217-
.ShouldReturn()
218-
.Ok(result => result
219-
.WithModelOfType<List<MyResponseModel>>()
220-
.Passing(model => model.Count == 10));
212+
=> MyMvc // Start a test case.
213+
.Controller<HomeController>(instance => instance // Arrange the controller under test.
214+
.WithUser("TestUser") // Set an authenticated user to the request.
215+
.WithData(MyTestData.GetData())) // Populate the application DbContext.
216+
.Calling(c => c.Index()) // Act - invoke the action under test.
217+
.ShouldReturn() // Assert action behavior.
218+
.Ok(result => result // Validate the action result type.
219+
.WithModelOfType<List<MyResponseModel>>() // Check the response model type.
220+
.Passing(model => model.Count == 10)); // Assert specific model properties.
221221
}
222222
}
223223
```

0 commit comments

Comments
 (0)