Test first
-
Upload
ryan-riley -
Category
Technology
-
view
234 -
download
0
Transcript of Test first
Test-firstFunctional-firstWeb API
Ryan Riley
Software DeveloperLogos Bible Software
WebApiContribWebApiKoansF#xFrank
A Brief History of Web API
What is Web API?MVC
http://blogs.msdn.com/b/kiranchalla/archive/2012/05/05/asp-net-mvc4-web-api-stack-diagram.aspx
What is Web API?System.Net.Http
http://blogs.msdn.com/b/kiranchalla/archive/2012/05/05/asp-net-mvc4-web-api-stack-diagram.aspx
What is Web API?Hosting
http://blogs.msdn.com/b/kiranchalla/archive/2012/05/05/asp-net-mvc4-web-api-stack-diagram.aspx
Unit Testing withHttpClient &HttpServer
Too manyconcerns
1. Routing2. Authentication/Authorization3. Other HttpConfiguration settings4. Action selection5. Action result6. Use of MessageHandlers7. HttpResponseMessage details8. Content formatting
Focus Your Tests
What’s the base?
HttpRequestMessage -> HttpResponseMessage
Coincidence?
Coincidence?
Why focus on this one function?
The Boundary
ClientService
Boundary(HTTP)
Domain
Is this really useful?
Building with functions
Contact ManagerRedux
Re-integration
Going Deeper
ApiRouter
One of many contributions from Darrel MillerRouting via HttpMessageHandler (a.k.a. function)Goal: full control over resource routingGoal: nested resources
Functions all the way!
Could you build an API using only Message Handlers?
Could you build an API with functions only?
Frank
Wrap in an HttpMessageHandlerF# for first-class function supportBarely scratches the surface
Summary
Questions?
Thank you
http://spkr8.com/t/13571