Skip to content

Commit a3aea5c

Browse files
committed
Added HttpResponseException with HttpResponseMessage to README.md (closes #116)
1 parent b747fe6 commit a3aea5c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

documentation/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,18 @@ MyWebApi
386386
.ShouldThrow()
387387
.HttpResponseException()
388388
.WithStatusCode(HttpStatusCode.NotFound);
389+
390+
// tests whether the action throws HttpResponseException
391+
// with specific HttpResponseMessage
392+
MyWebApi
393+
.Controller<WebApiController>()
394+
.Calling(c => c.SomeAction())
395+
.ShouldThrow()
396+
.HttpResponseException()
397+
.WithHttpResponseMessage()
398+
.WithVersion(1, 1)
399+
.AndAlso() // AndAlso is not necessary
400+
.WithStatusCode(HttpStatusCode.InternalServerError);
389401
```
390402

391403
[To top](#table-of-contents)

0 commit comments

Comments
 (0)