Test first

25
Test-first Functional- first Web API

Transcript of Test first

Page 1: Test first

Test-firstFunctional-firstWeb API

Page 2: Test first

Ryan Riley

Software DeveloperLogos Bible Software

WebApiContribWebApiKoansF#xFrank

Page 3: Test first

A Brief History of Web API

Page 7: Test first

Unit Testing withHttpClient &HttpServer

Page 8: Test first

Too manyconcerns

1. Routing2. Authentication/Authorization3. Other HttpConfiguration settings4. Action selection5. Action result6. Use of MessageHandlers7. HttpResponseMessage details8. Content formatting

Page 9: Test first

Focus Your Tests

Page 10: Test first

What’s the base?

HttpRequestMessage -> HttpResponseMessage

Page 11: Test first

Coincidence?

Page 12: Test first

Coincidence?

Page 13: Test first

Why focus on this one function?

Page 14: Test first

The Boundary

ClientService

Boundary(HTTP)

Domain

Page 15: Test first

Is this really useful?

Page 16: Test first

Building with functions

Page 17: Test first

Contact ManagerRedux

Page 18: Test first

Re-integration

Page 19: Test first

Going Deeper

Page 20: Test first

ApiRouter

One of many contributions from Darrel MillerRouting via HttpMessageHandler (a.k.a. function)Goal: full control over resource routingGoal: nested resources

Page 21: Test first

Functions all the way!

Could you build an API using only Message Handlers?

Could you build an API with functions only?

Page 22: Test first

Frank

Wrap in an HttpMessageHandlerF# for first-class function supportBarely scratches the surface

Page 23: Test first

Summary

Page 24: Test first

Questions?

Page 25: Test first

Thank you

http://spkr8.com/t/13571