Skip to content

Commit d1c3144

Browse files
authored
Merge branch 'development' into 3.1Merge
2 parents 39a843f + d1fdb4b commit d1c3144

File tree

4 files changed

+44
-28
lines changed

4 files changed

+44
-28
lines changed

README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
<h1><img src="https://raw.githubusercontent.com/ivaylokenov/MyTested.AspNetCore.Mvc/master/tools/logo.png" align="left" alt="MyTested.AspNetCore.Mvc" width="100">&nbsp; MyTested.AspNetCore.Mvc - Fluent Testing<br />&nbsp; Library for ASP.NET Core MVC</h1>
22

3-
## Special Sponsors
3+
## Diamond Sponsors
44

55
<table>
66
<tbody>
77
<tr>
88
<td align="center" valign="middle">
9-
<a href="http://bit.ly/bellatrixsolutions" target="_blank">
10-
<img width="323px" src="https://user-images.githubusercontent.com/3391906/68993273-d4f5c700-087e-11ea-9b39-e173733fcbfb.png" alt="The Ultimate Cross-Platform .NET Framework">
11-
</a>
12-
</td>
13-
<td align="center" valign="middle">
14-
<a href="https://www.jetbrains.com/?from=MyTestedASP.NET" target="_blank">
15-
<img width="323px" src="https://user-images.githubusercontent.com/3391906/72542498-ee21f080-388c-11ea-92ac-0b0153028933.png" alt="JetBrains">
16-
</a>
9+
<a href="http://bit.ly/3da6h7f" target="_blank">
10+
<img width="323px" src="https://user-images.githubusercontent.com/3391906/77253785-5b734880-6c65-11ea-92d5-71dcfc833fe0.png">
11+
</a>
1712
</td>
1813
</tr>
1914
</tbody>
@@ -24,6 +19,11 @@
2419
<table>
2520
<tbody>
2621
<tr>
22+
<td align="center" valign="middle">
23+
<a href="https://bit.ly/ciu-zuehlke" target="_blank">
24+
<img width="148px" src="https://user-images.githubusercontent.com/3391906/84595391-4ec75080-ae60-11ea-8bc4-2b5e4b17a345.jpg">
25+
</a>
26+
</td>
2727
<td align="center" valign="middle">
2828
<a href="https://softuni.org/" target="_blank">
2929
<img width="148px" src="https://softuni.org/platform/assets/icons/logo.svg">
@@ -48,6 +48,25 @@
4848
</tbody>
4949
</table>
5050

51+
## Special Sponsors
52+
53+
<table>
54+
<tbody>
55+
<tr>
56+
<td align="center" valign="middle">
57+
<a href="http://bit.ly/bellatrixsolutions" target="_blank">
58+
<img width="148px" src="https://user-images.githubusercontent.com/3391906/68993273-d4f5c700-087e-11ea-9b39-e173733fcbfb.png" alt="The Ultimate Cross-Platform .NET Framework">
59+
</a>
60+
</td>
61+
<td align="center" valign="middle">
62+
<a href="https://www.jetbrains.com/?from=MyTestedASP.NET" target="_blank">
63+
<img width="148px" src="https://user-images.githubusercontent.com/3391906/72542498-ee21f080-388c-11ea-92ac-0b0153028933.png" alt="JetBrains">
64+
</a>
65+
</td>
66+
</tr>
67+
</tbody>
68+
</table>
69+
5170
## Project Description
5271

5372
**MyTested.AspNetCore.Mvc** is a strongly-typed unit testing library providing an easy fluent interface to test the [ASP.NET Core](https://github.com/aspnet/AspNetCore) framework, perfectly suitable for both MVC and API scenarios. It is testing framework agnostic so that you can combine it with a test runner of your choice (e.g. [xUnit](https://github.com/xunit/xunit), [NUnit](https://github.com/nunit/nunit), etc.).

docs/_docfx/tutorial/helpers.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ public void AddressAndPaymentShouldRerurnRedirectWithValidData(
186186

187187
Running this test will give us the following strange error message:
188188

189-
``` When calling AddressAndPayment action in CheckoutController expected redirect result to have resolved location to '/Checkout/Complete/1', but in fact received '/Home/Complete/1'.
189+
```
190+
When calling AddressAndPayment action in CheckoutController expected redirect result to have resolved location to '/Checkout/Complete/1', but in fact received '/Home/Complete/1'.
190191
```
191192

192193
The problem is that the request path is empty which makes the action route data being invalid. For that reason, we are receiving wrong redirection location. The fix is easy - just call **"WithRouteData"**:

docs/_docfx/tutorial/routing.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The simplest route test possible:
5151

5252
```c#
5353
[Fact]
54-
public void GetErrorActionShouldBeRoutedSuccessfuly()
54+
public void GetErrorActionShouldBeRoutedSuccessfully()
5555
=> MyRouting
5656
.Configuration()
5757
.ShouldMap("/Home/Error")
@@ -71,11 +71,11 @@ public async Task<IActionResult> AddToCart(int id)
7171
}
7272
```
7373

74-
Create **"ShoppingCartRouteTest""** class and add the following test:
74+
Create **"ShoppingCartRouteTest"** class and add the following test:
7575

7676
```c#
7777
[Fact]
78-
public void GetAddToCartActionShouldBeRoutedSuccessfuly()
78+
public void GetAddToCartActionShouldBeRoutedSuccessfully()
7979
=> MyRouting
8080
.Configuration()
8181
.ShouldMap("/ShoppingCart/AddToCart/1")
@@ -91,11 +91,11 @@ public async Task<IActionResult> Browse(string genre)
9191
}
9292
```
9393

94-
Create **"StoreRouteTest""** class and add the following test:
94+
Create **"StoreRouteTest"** class and add the following test:
9595

9696
```c#
9797
[Fact]
98-
public void GetBrowseActionShouldBeRoutedSuccessfuly()
98+
public void GetBrowseActionShouldBeRoutedSuccessfully()
9999
=> MyRouting
100100
.Configuration()
101101
.ShouldMap("/Store/Browse?genre=HipHop")
@@ -125,7 +125,7 @@ We do not want to test the **"MusicStoreContext"** and the **"IMemoryCache"** ac
125125

126126
```c#
127127
[Fact]
128-
public void GetIndexActionShouldBeRoutedSuccessfuly()
128+
public void GetIndexActionShouldBeRoutedSuccessfully()
129129
=> MyRouting
130130
.Configuration()
131131
.ShouldMap("/Home")
@@ -154,7 +154,7 @@ The following test will fail right away:
154154

155155
```c#
156156
[Fact]
157-
public void PostRemoveFromCartActionShouldBeRoutedSuccessfuly()
157+
public void PostRemoveFromCartActionShouldBeRoutedSuccessfully()
158158
=> MyRouting
159159
.Configuration()
160160
.ShouldMap("/ShoppingCart/RemoveFromCart/1")
@@ -167,7 +167,7 @@ We are testing with HTTP Get request while the action is restricted only for HTT
167167

168168
```c#
169169
[Fact]
170-
public void PostRemoveFromCartActionShouldBeRoutedSuccessfuly()
170+
public void PostRemoveFromCartActionShouldBeRoutedSuccessfully()
171171
=> MyRouting
172172
.Configuration()
173173
.ShouldMap(request => request // <---
@@ -225,7 +225,7 @@ Let's update the test to make it pass:
225225

226226
```c#
227227
[Fact]
228-
public void PostRemoveFromCartActionShouldBeRoutedSuccessfuly()
228+
public void PostRemoveFromCartActionShouldBeRoutedSuccessfully()
229229
=> MyRouting
230230
.Configuration()
231231
.ShouldMap(request => request
@@ -245,7 +245,7 @@ Let's test a **"CheckoutController"** action, because all actions in that contro
245245

246246
```c#
247247
[Fact]
248-
public void GetAddressAndPaymentActionShouldBeRoutedSuccessfuly()
248+
public void GetAddressAndPaymentActionShouldBeRoutedSuccessfully()
249249
=> MyRouting
250250
.Configuration()
251251
.ShouldMap(request => request
@@ -290,7 +290,7 @@ Let's test that route! In **"Routing"**, create an **"Admin"** folder. In it cre
290290

291291
```c#
292292
[Fact]
293-
public void GetIndexActionShouldBeRoutedSuccessfuly()
293+
public void GetIndexActionShouldBeRoutedSuccessfully()
294294
=> MyRouting
295295
.Configuration()
296296
.ShouldMap(request => request
@@ -320,7 +320,7 @@ The login view model should come from the request form so we may decide to ignor
320320

321321
```c#
322322
[Fact]
323-
public void PostLoginActionShouldBeRoutedSuccessfuly()
323+
public void PostLoginActionShouldBeRoutedSuccessfully()
324324
=> MyRouting
325325
.Configuration()
326326
.ShouldMap(request => request

docs/_docfx/tutorial/viewcomponents.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ MyViewComponent<CartSummaryComponent>
118118
.Instance()
119119
.WithSession(session => session
120120
.WithEntry("Session", "TestCart"))
121-
.WithData(db => db
122-
.WithEntities(entities => entities
123-
.AddRange(GetCartItems("TestCart", "TestAlbum"))))
121+
.WithData(CartItemData.GetMany("TestCart", "TestAlbum"))
124122
.InvokedWith(vc => vc.InvokeAsync()) // <---
125123
```
126124

@@ -133,9 +131,7 @@ MyViewComponent<CartSummaryComponent>
133131
.Instance()
134132
.WithSession(session => session
135133
.WithEntry("Session", "TestCart"))
136-
.WithData(db => db
137-
.WithEntities(entities => entities
138-
.AddRange(GetCartItems("TestCart", "TestAlbum"))))
134+
.WithData(CartItemData.GetMany("TestCart", "TestAlbum"))
139135
.InvokedWith(vc => vc.InvokeAsync())
140136
.ShouldHave() // <---
141137
.ViewBag(viewBag => viewBag

0 commit comments

Comments
 (0)