Skip to content

Commit bf8df69

Browse files
committed
Added Services section to the tutorial (#132)
1 parent 7645b1d commit bf8df69

15 files changed

Lines changed: 1185 additions & 29 deletions

docs/_docfx/tutorial/controllers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ My Tested ASP.NET Core MVC provides a very easy way to arrange the model state,
1717

1818
```c#
1919
[Fact]
20-
public void ChangePassword_ShouldReturn_ViewWithSameModel_WithInvalidModelState()
20+
public void ChangePasswordShouldReturnViewWithSameModelWithInvalidModelState()
2121
{
2222
MyController<ManageController>
2323
.Instance()
@@ -132,7 +132,7 @@ To continue, let's bring back the test to its last passing state:
132132

133133
```c#
134134
[Fact]
135-
public void ChangePassword_ShouldReturn_ViewWithSameModel_WithInvalidModelState()
135+
public void ChangePasswordShouldReturnViewWithSameModelWithInvalidModelState()
136136
{
137137
MyController<ManageController>
138138
.Instance()
@@ -150,7 +150,7 @@ We are still not asserting whether the view model is the same object as the prov
150150

151151
```c#
152152
[Fact]
153-
public void ChangePassword_ShouldReturn_ViewWithSameModel_WithInvalidModelState()
153+
public void ChangePasswordShouldReturnViewWithSameModelWithInvalidModelState()
154154
{
155155
var model = new ChangePasswordViewModel
156156
{

docs/_docfx/tutorial/database.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Let's try to test an action using the **"DbContext"**. An easy one is **"Index"*
88

99
```c#
1010
[Fact]
11-
public void Index_ShouldReturn_ViewWithGenres()
11+
public void IndexShouldReturnViewWithGenres()
1212
=> MyController<StoreController>
1313
.Instance()
1414
.Calling(c => c.Index())
@@ -78,7 +78,7 @@ The best part of the test is the fact that these data objects live in scoped per
7878

7979
```c#
8080
[Fact]
81-
public void Index_ShouldReturn_ViewWithGenres()
81+
public void IndexShouldReturnViewWithGenres()
8282
=> MyController<StoreController>
8383
.Instance()
8484
.WithDbContext(dbContext => dbContext
@@ -92,7 +92,7 @@ public void Index_ShouldReturn_ViewWithGenres()
9292
.Passing(model => model.Count == 2);
9393

9494
[Fact]
95-
public void I_Will_Show_Scoped_Database_Services()
95+
public void IWillShowScopedDatabaseServices()
9696
=> MyController<StoreController>
9797
.Instance()
9898
.WithDbContext(dbContext => dbContext
@@ -129,7 +129,7 @@ Create a **"StoreManagerControllerTest"**, add the necessary usings and write th
129129

130130
```c#
131131
[Fact]
132-
public void Create_ShouldSaveAlbum_WithValidModelState_And_Redirect()
132+
public void CreateShouldSaveAlbumWithValidModelStateAndRedirect()
133133
{
134134
var album = new Album
135135
{

docs/_docfx/tutorial/gettingstarted.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The only thing we need to assert in the tested action is whether it returns a vi
6363

6464
```c#
6565
[Fact]
66-
public void AddressAndPayment_ShouldReturn_DefaultView()
66+
public void AddressAndPaymentShouldReturnDefaultView()
6767
=> MyMvc
6868
.Controller<CheckoutController>()
6969
.Calling(c => c.AddressAndPayment())
@@ -214,7 +214,7 @@ To finish this section let's make the test fail because of an invalid assertion
214214

215215
```c#
216216
[Fact]
217-
public void AddressAndPayment_ShouldReturn_DefaultView()
217+
public void AddressAndPaymentShouldReturnDefaultView()
218218
=> MyController<CheckoutController>
219219
.Instance()
220220
.Calling(c => c.AddressAndPayment())
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# HTTP & Authentication
2+
3+
This section will cover HTTP related testing and user identity authentication.
4+
5+
## HTTP requests
6+

docs/_docfx/tutorial/packages.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The **"MyMvc"** class is only available in the **"MyTested.AspNetCore.Mvc"** pac
4545

4646
```c#
4747
[Fact]
48-
public void AddressAndPayment_ShouldReturn_DefaultView()
48+
public void AddressAndPaymentShouldReturnDefaultView()
4949
=> MyController<CheckoutController>
5050
.Instance()
5151
.Calling(c => c.AddressAndPayment())
@@ -67,7 +67,7 @@ Add the necessary usings and write the following test into the **"ManageControll
6767

6868
```c#
6969
[Fact]
70-
public void RemoveLogin_ShouldReturn_RedirectToAction_WithNoUser()
70+
public void RemoveLoginShouldReturnRedirectToActionWithNoUser()
7171
=> MyController<ManageController>
7272
.Instance()
7373
.Calling(c => c.RemoveLogin(null, null))
@@ -85,7 +85,7 @@ As a bonus, let's assert some details of the redirect action result. We can see
8585

8686
```c#
8787
[Fact]
88-
public void RemoveLogin_ShouldReturn_RedirectToAction_WithNoUser()
88+
public void RemoveLoginShouldReturnRedirectToActionWithNoUser()
8989
=> MyController<ManageController>
9090
.Instance()
9191
.Calling(c => c.RemoveLogin(

0 commit comments

Comments
 (0)