Skip to content

Commit 50d69db

Browse files
committed
Enhanced README.md for version 0.1
1 parent 3de29a4 commit 50d69db

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ MyWebApi
119119
.ShouldReturn(typeof(IList<>)); // works with IEnumerable<> (or IList<ResponseModel>) too by using polymorphism
120120
```
121121

122-
#### OkResult
122+
#### Ok result
123123

124124
```c#
125125
// tests whether the action returns OkResult
@@ -166,6 +166,16 @@ MyWebApi
166166
.Calling(c => c.SomeAction())
167167
.ShouldReturnOk()
168168
.WithResponseModel<ResponseModel>(m => m.Id == 1);
169+
170+
// tests for model state errors for the response model (not very useful in practice)
171+
MyWebApi
172+
.Controller<WebApiController>()
173+
.Calling(c => c.SomeAction())
174+
.ShouldReturnOk()
175+
.WithResponseModel<ResponseModel>()
176+
.ContainingModelStateErrorFor(m => m.SomeProperty).ThatEquals("Error message")
177+
.And()
178+
.ContainingNoModelStateErrorFor(m => m.AnotherProperty);
169179
```
170180

171181
## Any questions, comments or additions?

0 commit comments

Comments
 (0)