7digital / SevenDigital.Api.Wrapper

A fluent c# wrapper for the 7digital API
MIT License
16 stars 29 forks source link

Refactored to remove UriSigner. #109

Closed gregsochanik closed 10 years ago

gregsochanik commented 10 years ago

In order to do this I had to invert a switch statement that selected which RequestHandler to use based on the current request Method, so now the RequestCoordinator ctor signature has changed to take an IEnumerable<RequestHandler>. (https://github.com/gregsochanik/SevenDigital.Api.Wrapper/compare/crenna-oauth?expand=1#diff-80302ed9266f92bd2e22a9a34809bb66R25)

This may cause a breaking change to the way you instantiate an instance of FluentApi, but if you're using a decent IoC framework you shouldn't have a problem.

I've included a static RequestHandlerFactory that sets up the concrete GetRequestHandler and PostRequestHandlers for now.

This work is necessary not only for making replacing the OAuth code with the http://www.nuget.org/packages/OAuth/ library, but also in order to support requesting the Api with non GET and POST verbs in the future.

The Locker Test changes are to a dummy locker I created with a Token and Secret that I haven't committed. It checks for the existance of the TEST CONTENT dummy release.

AnthonySteele commented 10 years ago

I had a closer look at it, seems fine to me.

Style - how to chose between the form used here

 public IEnumerable<IFoo> GetFoos()
 {
      yield return new FooOne();
      yield return new FooTwo();
 }

and the more traditional

 public IEnumerable<IFoo> GetFoos()
 {
      return new List<IFoo>
       {
           new FooOne(),
           new FooTwo()
       }
 }

Mater of taste I suppose?