File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -209,15 +209,15 @@ namespace MyApp.Tests.Controllers
209
209
{
210
210
[Fact ]
211
211
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.
221
221
}
222
222
}
223
223
```
You can’t perform that action at this time.
0 commit comments