Skip to content

Commit 177d26f

Browse files
committed
Added Controller setup instructions
1 parent a01eb22 commit 177d26f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# MyWebApi - ASP.NET Web API Fluent Testing Framework
2+
====================================
3+
24
MyWebApi is unit testing framework providing easy fluent interface to test the ASP.NET Web API framework. Inspired by [TestStack.FluentMVCTesting](https://github.com/TestStack/TestStack.FluentMVCTesting) and [ChaiJS](https://github.com/chaijs/chai)
35

46
[![Build status](https://ci.appveyor.com/api/projects/status/738pm1kuuv7yw1t5?svg=true)](https://ci.appveyor.com/project/ivaylokenov/mywebapi)
57

8+
## How to use
9+
10+
### Controllers
11+
12+
You have a couple of options from which you can setup the controller you want to test. The framework gives you static `MyWebApi` class from which the test builder starts.
13+
14+
```c#
15+
// instantiates controller with parameterless constructor
16+
MyWebApi
17+
.Controller<WebApiController>();
18+
19+
// instantiates controller with constructor function to resolve dependencies
20+
MyWebApi
21+
.Controller(() => new WebApiController(mockedInjectedService));
22+
```
23+
24+
## Any questions, comments or additions?
25+
26+
Leave an issue on the [issues page](https://github.com/ivaylokenov/MyWebApi/issues) or send a [pull request](https://github.com/ivaylokenov/MyWebApi/pulls).

0 commit comments

Comments
 (0)