@@ -192,7 +192,7 @@ A controller integration test uses the globally registered services from the `Te
192
192
// and tests for valid model state,
193
193
// and tests for added by the action view bag entry,
194
194
// and tests for view result and model with specific assertions.
195
- MyController < MyController >
195
+ MyController < MyMvcController >
196
196
.Instance ()
197
197
.WithUser (user => user
198
198
.WithUsername (" MyUserName" ))
@@ -219,7 +219,7 @@ MyController<MyController>
219
219
// and sets DbContext data for the current test,
220
220
// and tests for added by the action cache entry,
221
221
// and tests for view result with specific model type.
222
- MyController < MyController >
222
+ MyController < MyMvcController >
223
223
.Instance ()
224
224
.WithOptions (options => options
225
225
.For <MyAppSettings >(settings => settings .Cache = true ))
@@ -246,7 +246,7 @@ MyController<MyController>
246
246
// and tests for saved data in the DbContext after the action call,
247
247
// and tests for added by the action temp data entry with а specific key,
248
248
// and tests for redirect result to a specific action.
249
- MyController < MyController >
249
+ MyController < MyMvcController >
250
250
.Instance ()
251
251
.Calling (c => c .MyAction (new MyFormModel
252
252
{
@@ -282,7 +282,7 @@ A controller unit test uses service mocks explicitly provided in each separate a
282
282
``` c#
283
283
// Instantiates controller with the provided service mocks,
284
284
// and tests for view result.
285
- MyController < MyController >
285
+ MyController < MyMvcController >
286
286
.Instance ()
287
287
.WithDependencies (
288
288
serviceMock ,
@@ -294,7 +294,7 @@ MyController<MyController>
294
294
295
295
// Instantiates controller with the provided service mocks,
296
296
// and tests for view result.
297
- MyController < MyController >
297
+ MyController < MyMvcController >
298
298
.Instance ()
299
299
.WithDependencies (dependencies => dependencies
300
300
.With <IService >(serviceMock )
@@ -366,15 +366,15 @@ An attribute declaration test validates controller and action attribute declarat
366
366
367
367
``` c#
368
368
// Tests for specific controller attributes - Area and Authorize.
369
- MyController < MyController >
369
+ MyController < MyMvcController >
370
370
.Instance ()
371
371
.ShouldHave ()
372
372
.Attributes (attributes => attributes
373
373
.SpecifyingArea (ControllerConstants .AdministratorArea )
374
374
.RestrictingForAuthorizedRequests (ControllerConstants .AdministratorRole ));
375
375
376
376
// Tests for specific action attributes - HttpGet, AllowAnonymous, ValidateAntiForgeryToken, and ActionName.
377
- MyController < MyController >
377
+ MyController < MyMvcController >
378
378
.Instance ()
379
379
.Calling (c => c .MyAction (With .Empty <int >())) // Provides no value for the action parameter.
380
380
.ShouldHave ()
@@ -391,7 +391,7 @@ All applicable methods are available on the view component testing API too:
391
391
392
392
``` c#
393
393
// View component integration test.
394
- MyViewComponent < MyComponent >
394
+ MyViewComponent < MyMvcController >
395
395
.Instance ()
396
396
.WithSession (session => session
397
397
.WithEntry (" MySession" , " MySessionValue" ))
@@ -409,7 +409,7 @@ MyViewComponent<MyComponent>
409
409
.WithModelOfType <MyResponseModel >();
410
410
411
411
// View component unit test.
412
- MyViewComponent < MyComponent >
412
+ MyViewComponent < MyMvcController >
413
413
.Instance ()
414
414
.WithDependencies (
415
415
serviceMock ,
@@ -430,7 +430,7 @@ MyViewComponent<MyComponent>
430
430
MyMvc
431
431
432
432
// Arrange
433
- .Controller <MyController >()
433
+ .Controller <MyMvcController >()
434
434
.WithHttpRequest (request => request
435
435
.WithFormField (" MyFormField" , " MyFormFieldValue" ))
436
436
.WithSession (session => session
@@ -457,7 +457,7 @@ MyMvc
457
457
// With variables.
458
458
459
459
// Arrange
460
- var controller = MyController < MyController >
460
+ var controller = MyController < MyMvcController >
461
461
.Instance ()
462
462
.WithUser (username , new [] { role })
463
463
.WithData (MyTestData .GetData ());
@@ -482,7 +482,7 @@ Just random **MyTested.AspNetCore.Mvc** assertions:
482
482
// with specific tests for the error messages,
483
483
// and tests whether the action returns view with the same request model.
484
484
MyMvc
485
- .Controller <MyController >()
485
+ .Controller <MyMvcController >()
486
486
.Calling (c => c .MyAction (myRequestWithErrors ))
487
487
.ShouldHave ()
488
488
.ModelState (modelState => modelState
@@ -498,7 +498,7 @@ MyMvc
498
498
// Tests whether the action throws an exception
499
499
// of a particular type and with a particular error message.
500
500
MyMvc
501
- .Controller <MyController >()
501
+ .Controller <MyMvcController >()
502
502
.Calling (c => c .MyActionWithException ())
503
503
.ShouldThrow ()
504
504
.Exception ()
@@ -511,7 +511,7 @@ MyMvc
511
511
// and writes to the response specific content type,
512
512
// custom header, and custom cookie.
513
513
MyMvc
514
- .Controller <MyController >()
514
+ .Controller <MyMvcController >()
515
515
.Calling (c => c .MyAction ())
516
516
.ShouldHave ()
517
517
.HttpResponse (response => response
0 commit comments