Skip to content

Commit 30e9fc1

Browse files
authored
Updated README.md
1 parent d2a42a3 commit 30e9fc1

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ A controller integration test uses the globally registered services from the `Te
192192
// and tests for valid model state,
193193
// and tests for added by the action view bag entry,
194194
// and tests for view result and model with specific assertions.
195-
MyController<MyController>
195+
MyController<MyMvcController>
196196
.Instance()
197197
.WithUser(user => user
198198
.WithUsername("MyUserName"))
@@ -219,7 +219,7 @@ MyController<MyController>
219219
// and sets DbContext data for the current test,
220220
// and tests for added by the action cache entry,
221221
// and tests for view result with specific model type.
222-
MyController<MyController>
222+
MyController<MyMvcController>
223223
.Instance()
224224
.WithOptions(options => options
225225
.For<MyAppSettings>(settings => settings.Cache = true))
@@ -246,7 +246,7 @@ MyController<MyController>
246246
// and tests for saved data in the DbContext after the action call,
247247
// and tests for added by the action temp data entry with а specific key,
248248
// and tests for redirect result to a specific action.
249-
MyController<MyController>
249+
MyController<MyMvcController>
250250
.Instance()
251251
.Calling(c => c.MyAction(new MyFormModel
252252
{
@@ -282,7 +282,7 @@ A controller unit test uses service mocks explicitly provided in each separate a
282282
```c#
283283
// Instantiates controller with the provided service mocks,
284284
// and tests for view result.
285-
MyController<MyController>
285+
MyController<MyMvcController>
286286
.Instance()
287287
.WithDependencies(
288288
serviceMock,
@@ -294,7 +294,7 @@ MyController<MyController>
294294

295295
// Instantiates controller with the provided service mocks,
296296
// and tests for view result.
297-
MyController<MyController>
297+
MyController<MyMvcController>
298298
.Instance()
299299
.WithDependencies(dependencies => dependencies
300300
.With<IService>(serviceMock)
@@ -366,15 +366,15 @@ An attribute declaration test validates controller and action attribute declarat
366366

367367
```c#
368368
// Tests for specific controller attributes - Area and Authorize.
369-
MyController<MyController>
369+
MyController<MyMvcController>
370370
.Instance()
371371
.ShouldHave()
372372
.Attributes(attributes => attributes
373373
.SpecifyingArea(ControllerConstants.AdministratorArea)
374374
.RestrictingForAuthorizedRequests(ControllerConstants.AdministratorRole));
375375

376376
// Tests for specific action attributes - HttpGet, AllowAnonymous, ValidateAntiForgeryToken, and ActionName.
377-
MyController<MyController>
377+
MyController<MyMvcController>
378378
.Instance()
379379
.Calling(c => c.MyAction(With.Empty<int>())) // Provides no value for the action parameter.
380380
.ShouldHave()
@@ -391,7 +391,7 @@ All applicable methods are available on the view component testing API too:
391391

392392
```c#
393393
// View component integration test.
394-
MyViewComponent<MyComponent>
394+
MyViewComponent<MyMvcController>
395395
.Instance()
396396
.WithSession(session => session
397397
.WithEntry("MySession", "MySessionValue"))
@@ -409,7 +409,7 @@ MyViewComponent<MyComponent>
409409
.WithModelOfType<MyResponseModel>();
410410

411411
// View component unit test.
412-
MyViewComponent<MyComponent>
412+
MyViewComponent<MyMvcController>
413413
.Instance()
414414
.WithDependencies(
415415
serviceMock,
@@ -430,7 +430,7 @@ MyViewComponent<MyComponent>
430430
MyMvc
431431

432432
// Arrange
433-
.Controller<MyController>()
433+
.Controller<MyMvcController>()
434434
.WithHttpRequest(request => request
435435
.WithFormField("MyFormField", "MyFormFieldValue"))
436436
.WithSession(session => session
@@ -457,7 +457,7 @@ MyMvc
457457
// With variables.
458458
459459
// Arrange
460-
var controller = MyController<MyController>
460+
var controller = MyController<MyMvcController>
461461
.Instance()
462462
.WithUser(username, new[] { role })
463463
.WithData(MyTestData.GetData());
@@ -482,7 +482,7 @@ Just random **MyTested.AspNetCore.Mvc** assertions:
482482
// with specific tests for the error messages,
483483
// and tests whether the action returns view with the same request model.
484484
MyMvc
485-
.Controller<MyController>()
485+
.Controller<MyMvcController>()
486486
.Calling(c => c.MyAction(myRequestWithErrors))
487487
.ShouldHave()
488488
.ModelState(modelState => modelState
@@ -498,7 +498,7 @@ MyMvc
498498
// Tests whether the action throws an exception
499499
// of a particular type and with a particular error message.
500500
MyMvc
501-
.Controller<MyController>()
501+
.Controller<MyMvcController>()
502502
.Calling(c => c.MyActionWithException())
503503
.ShouldThrow()
504504
.Exception()
@@ -511,7 +511,7 @@ MyMvc
511511
// and writes to the response specific content type,
512512
// custom header, and custom cookie.
513513
MyMvc
514-
.Controller<MyController>()
514+
.Controller<MyMvcController>()
515515
.Calling(c => c.MyAction())
516516
.ShouldHave()
517517
.HttpResponse(response => response

0 commit comments

Comments
 (0)